Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix json game marshalling #104

Merged
merged 2 commits into from
Oct 2, 2021
Merged

Fix json game marshalling #104

merged 2 commits into from
Oct 2, 2021

Conversation

joshprzybyszewski
Copy link
Owner

What broke / What you're adding

dynamo exposed an issue in the game unmarshalling. The resulting Hands field is empty right after creation, and that panics when we try to deal out cards.

How you did it

write a unit test to verify that. then simply check for the nil fields and instantiate them to empty.

How to test it and how to try to break it

CI was broken. now CI is happy.

@codecov
Copy link

codecov bot commented Oct 2, 2021

Codecov Report

Merging #104 (12cb8bc) into master (e5be80f) will decrease coverage by 0.01%.
The diff coverage is 66.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
- Coverage   69.79%   69.79%   -0.01%     
==========================================
  Files          80       80              
  Lines        3476     3482       +6     
==========================================
+ Hits         2426     2430       +4     
- Misses        831      832       +1     
- Partials      219      220       +1     
Impacted Files Coverage Δ
jsonutils/gameUnmarshaller.go 57.89% <66.67%> (+4.05%) ⬆️
server/persistence/mongodb/mongodb_service_game.go 68.66% <0.00%> (-1.49%) ⬇️
server/play/cut.go 50.00% <0.00%> (+5.88%) ⬆️

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 e5be80f...12cb8bc. Read the comment docs.

@joshprzybyszewski joshprzybyszewski merged commit ca366c3 into master Oct 2, 2021
@joshprzybyszewski joshprzybyszewski deleted the fixGameUnmarshal branch October 2, 2021 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant