joshprzybyszewski / cribbage

A cribbage scorer and game
MIT License
2 stars 1 forks source link

clean up persistence tests #105

Closed joshprzybyszewski closed 3 years ago

joshprzybyszewski commented 3 years ago

What broke / What you're adding

I noticed that our unit tests are lacking in some regards. And then I noticed that our timestamps on player actions are balogna. I'd like to clean those up.

How you did it

Start by updating the checkPersistedGame func so that it makes more sense.

Then get rid of the time.Time field on the PlayerAction struct and replace it with a string - that's all we'll ever need. This means we can serialize to/from json without issues anymore.

How to test it and how to try to break it

CI updates makes sense. CI passes.

codecov[bot] commented 3 years ago

Codecov Report

Merging #105 (81c5f1c) into master (ca366c3) will increase coverage by 0.02%. The diff coverage is 70.00%.

:exclamation: Current head 81c5f1c differs from pull request most recent head ce7984a. Consider uploading reports for the commit ce7984a to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   69.73%   69.75%   +0.02%     
==========================================
  Files          80       80              
  Lines        3482     3488       +6     
==========================================
+ Hits         2428     2433       +5     
  Misses        833      833              
- Partials      221      222       +1     
Impacted Files Coverage Δ
network/player.go 94.55% <62.50%> (-5.45%) :arrow_down:
model/model.go 95.58% <100.00%> (+0.04%) :arrow_up:
server/persistence/mysql/games.go 70.43% <100.00%> (ø)
server/play/cut.go 50.00% <0.00%> (+5.88%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ca366c3...ce7984a. Read the comment docs.

joshprzybyszewski commented 3 years ago

I'd like these changes to go in to make https://github.com/joshprzybyszewski/cribbage/pull/101 a bit easier