-
Notifications
You must be signed in to change notification settings - Fork 217
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 encoding warnings in golden tests. #3247
Merged
iohk-bors
merged 2 commits into
master
from
jonathanknowles/fix-golden-json-encoding-warnings
Apr 22, 2022
Merged
Fix JSON encoding warnings in golden tests. #3247
iohk-bors
merged 2 commits into
master
from
jonathanknowles/fix-golden-json-encoding-warnings
Apr 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When running `cardano-wallet:test:unit` on `master`, we see many warnings of the following type: ``` WARNING: Encoding new random samples do not match lib/core/test/data/Cardano/Wallet/Api/ApiTypeName.json ``` These warnings emanate from round-trip JSON encoding tests, and are caused by changes to underlying types (or generators) that were not accompanied by updates of the golden files. This commit fixes this issue by regenerating the golden JSON files for types where warnings could be seen in the test log. As a result, we can see that some data types have coverage that is more complete than before. We now cover shared account keys: ```diff "samples": [ - "acct_xvk17d45ydqpaxgfn6cleg0wjyn4jwa3mpulqyqt0edcxqu9xl0xgzlqwv2gpvzgnautqq6vs96kh7xy3mhq6ulmgffnd92q2pzxk56h3ugwt055r", - "acct_xvk1t5hucj78c8a6tp7mg6yawpqsfv3jj3jwnua7lqd8hw985x3aavwndnjpcrn7xufmt983pj59h53uyw3hz5mtlcn2m8htya4ltnnzvwskxu4lg", - "acct_vk1zgfxrkh9hh5k3jtfx4them83sqtlkaeh6r746pp4q525z272hzequz0mzv", - "acct_xvk1h7ntzpvq56dsesexxhc2juejnsmd35sg9jkkeggxpfd9ypagywelxk03q6hv5xrs4h7r7gj8h3wamcrk9peyzd4334x8hdlehrnw77gnse8sk", - "acct_vk18t3c5gcw5c6ptg2hdzd47agr8gnz5ek5zmnd2qqge2vjz0h97u9sygp253", - "acct_vk157pl9lvysxulcwmee39afc2n83tp0edk03etgm4m09gyed0qfyssgncfe6", - "acct_vk1fwnwyhphwpclv59r4dr9ucsh3dmj243jl45772e2z2mpd4c0j3psdxjv6s", - "acct_xvk1efxvcetajem8yehnmmxd59y00e92n2ngpd32x86djsv9pq36w8hspagl6590kh0hgy4anv8m0sedn77fa6e9yypzf2ge62ftxdqxnrgn8tzy5", - "acct_xvk1l5e7juy5lw46uhslfdvmfrmzuf26azhj5suyj44r6xf9zeh4a874xdklkl676hvjxkurqwxqsdxpr5fye6v55xst894a5m8v3duepzsztqs57", - "acct_xvk14nf4re2c8kpme3xyw84ys3z48yrdxjqapxlw6vhggksu9nfcsdyhkr8dlmq3v2j3773zzqv5yzrt993ru0jr40qrfpd2qxwtn4ppwtgncwnzq" + "acct_shared_xvk1jsnrx395hzfx3nq4sxvrsdda8amz6zyq5kx37p0pmyxpnh4ya9yj7hec9vk7qrngs0a5pkykeu805829ftvj00mxhqrk8p2nrdhrrfcxnhv4r", + "acct_shared_vk1qkruhy3hxaqtkjyy3cgefra236lk0cdanmr3zfnxksxpujmjpnwqwc50ck", + "acct_shared_vk1lhgasafemhezu7fl25dkfkj8hzsnl4j6aeuzssffh6dmf86avsns6nulzr", + "acct_shared_xvk100cavmcspq45pw2cw49gzzldzctecn5a6w3cfyrmzustdp9vynv87mwvx3tps6a77uqf4xkh2txlt7prfrsw0lrateqqd7hlvsapppch5n6cu", + "acct_shared_vk1ltrzyjjvy2n6rq4c9vydcs9rnmchh00c67cxj9wntewq0pdfgjascwz53z", + "acct_shared_vk1599xlyyww6my9qpext89vszlk46jdnynwf69ffl6ewnf6j0ujcfqvd45ly", + "acct_shared_vk109nfu9vhrupctgays2vn894sageukjw9epezaxzpxa7m6usn5vtqdlut44", + "acct_shared_vk1tl63wah9ejqp60ex5524eerhz6mu6c3pvcqacmjalcq2j5frtz0sjm24q3", + "acct_vk1yhvt695w7e0t0ej7tqhzmcpepssydk9khzntp49j6y4yzcwkj7tqjv9un7", + "acct_xvk1dpvn4rvt2vrvr2wjsc9k5vsag9wqcecs47khtlgwj40j5gjc7vn7wg82fx8tw6etqjq42fph0d6ndngf3ef662ut3v7650h8jrkfl6qhsk83c" ``` We now cover more eras: ```diff "samples": [ "allegra", "byron", "mary", "shelley", + "alonzo", ] } ```
1 task
piotr-iohk
approved these changes
Apr 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
paweljakubas
approved these changes
Apr 22, 2022
bors r+ |
Build succeeded: |
iohk-bors
bot
deleted the
jonathanknowles/fix-golden-json-encoding-warnings
branch
April 22, 2022 08:00
WilliamKingNoel-Bot
pushed a commit
that referenced
this pull request
Apr 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes warnings of the following type when running
cardano-wallet-core:test:unit
:Details
These warnings emanate from round-trip JSON encoding tests, and are caused by changes to underlying types (or generators) that are not accompanied by updates of the golden files.
This commit fixes this issue by regenerating the golden JSON files for types where warnings could be seen in the test log.
As a result, we can see that some data types have coverage that is more complete than before.
Examples
ApiAccountKey
We now cover shared account keys:
ApiEra
We now cover more eras:
"samples": [ "allegra", "byron", "mary", "shelley", + "alonzo", ] }