Skip to content

Conversation

@Soupstraw
Copy link
Contributor

@Soupstraw Soupstraw commented Nov 18, 2025

Description

This PR adds a bunch of CBOR golden tests. There are two kinds of new tests in this PR:

I also added forEachEraVersion that runs tests with each valid protocol version in that era.

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch 2 times, most recently from 096540b to b840866 Compare November 19, 2025 13:42
@Soupstraw Soupstraw marked this pull request as ready for review November 19, 2025 13:42
@Soupstraw Soupstraw requested a review from a team as a code owner November 19, 2025 13:42
@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch 3 times, most recently from a47ac70 to b3aeb3b Compare November 19, 2025 14:10
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the direction where we are going with these golden tests!!!
Thank you for doing this work.

defaultTests =
describe "Alonzo tests" $ do
AdaPreservation.tests @AlonzoEra 50
Golden.tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to remove these tests?

I suspect what happened was you introduced a module with the same name into cardano-ledger-alonzo:testlib:Test.Cardano.Ledger.Alonzo.Golden as the one in cardano-ledger-alonzo-test:library:Test.Cardano.Ledger.Alonzo.Golden and this resulted in cabal complaining, which led to you removing this line.
Problem is that it effectively disables those tests, which we would like to keep, regardless how ugly they look.

An easy solution would be to simply moves the contents of this file: eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Golden.hs intto
eras/alonzo/impl/test/Test/Cardano/Ledger/Alonzo/GoldenSpec.hs. Note that you'll also need to move the actual golden files used by that module.

Copy link
Contributor Author

@Soupstraw Soupstraw Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I meant to replace it with Test.Cardano.Ledger.Binary.Golden and then call the old test tree from that spec, but then forgot to actually add the test here. I think merging those two modules together like you suggested makes much more sense anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried moving the tests out of Alonzo's test-suite, but it seems like it would entail moving some helper functions out of Mary's test-suite as well. I think this would be better done in a separate PR since there would be a lot of changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related #3623

@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch 5 times, most recently from f583a3d to 9de7817 Compare November 25, 2025 11:54
@Soupstraw Soupstraw requested a review from lehins November 25, 2025 11:54
@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch 2 times, most recently from 5c4aa3b to 38c6db3 Compare November 25, 2025 16:24
@Soupstraw Soupstraw marked this pull request as draft November 26, 2025 16:19
@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch from f9a82db to 2516532 Compare November 27, 2025 11:26
@Soupstraw Soupstraw marked this pull request as ready for review November 27, 2025 11:28
@Soupstraw Soupstraw force-pushed the jj/cbor-golden-tests branch from 2516532 to a8f435c Compare November 27, 2025 11:29
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.

Add positive duplicateCertsTx tests to Shelley and Conway

3 participants