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

Convert to use tasty-discover #127

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Aug 2, 2023

Changelog

- description: |
    Convert to use `tasty-discover`
  type: maintenance

Context

This relieves the developer from having to write the plumbing for new tests.

It also allow individual tests to be run.

The tests can be run as before:

cabal test cardano-cli-golden
Build profile: -w ghc-9.6.2 -O1
In order, the following will be built (use -v for more details):
 - cardano-cli-8.4.1.0 (test:cardano-cli-golden) (ephemeral targets)
Preprocessing test suite 'cardano-cli-golden' for cardano-cli-8.4.1.0..
Building test suite 'cardano-cli-golden' for cardano-cli-8.4.1.0..
Running 1 test suites...
Test suite cardano-cli-golden: RUNNING...
test/cardano-cli-golden/cardano-cli-golden.hs
  deserialise legacy signing Key:                              OK
      ✓ Test.Golden.Byron.SigningKeys.hprop_deserialise_legacy_signing_Key passed 1 test.
  deserialise nonLegacy signing Key:                           OK
      ✓ Test.Golden.Byron.SigningKeys.hprop_deserialise_nonLegacy_signing_Key passed 1 test.
  print legacy signing key address:                            OK (0.09s)
      ✓ Test.Golden.Byron.SigningKeys.hprop_print_legacy_signing_key_address passed 1 test.
  print nonLegacy signing key address:                         OK (0.08s)
      ✓ Test.Golden.Byron.SigningKeys.hprop_print_nonLegacy_signing_key_address passed 1 test.
  generate and read nonlegacy signingkeys:                     OK
      ✓ Test.Golden.Byron.SigningKeys.hprop_generate_and_read_nonlegacy_signingkeys passed 100 tests.
  migrate legacy to nonlegacy signingkeys:                     OK (0.04s)
      ✓ Test.Golden.Byron.SigningKeys.hprop_migrate_legacy_to_nonlegacy_signingkeys passed 1 test.
  deserialise NonLegacy Signing Key API:                       OK
      ✓ Test.Golden.Byron.SigningKeys.hprop_deserialise_NonLegacy_Signing_Key_API passed 1 test.
  deserialiseLegacy Signing Key API:                           OK
      ✓ Test.Golden.Byron.SigningKeys.hprop_deserialiseLegacy_Signing_Key_API passed 1 test.
  GovernanceCmdError
    StakeCredGovCmdError:                                      OK
        ✓ <interactive> passed 1 test.
    VotingCredentialDecodeGovCmdEror:                          OK
        ✓ <interactive> passed 1 test.
    WriteFileError:                                            OK
        ✓ <interactive> passed 1 test.
    ReadFileError:                                             OK
        ✓ <interactive> passed 1 test.
    NonUtf8EncodedConstitution:                                OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdTextEnvReadError:                             OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdCddlError:                                    OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdKeyReadError:                                 OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdCostModelReadError:                           OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdTextEnvWriteError:                            OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdEmptyUpdateProposalError:                     OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdMIRCertificateKeyRewardMistmach:              OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdCostModelsJsonDecodeErr:                      OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdEmptyCostModel:                               OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdUnexpectedKeyType:                            OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdPollOutOfBoundAnswer:                         OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdPollInvalidChoice:                            OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdDecoderError:                                 OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdVerifyPollError:                              OK
        ✓ <interactive> passed 1 test.
    GovernanceCmdWriteFileError:                               OK
        ✓ <interactive> passed 1 test.
    ShelleyGovernanceCmdMIRCertNotSupportedInConway:           OK
        ✓ <interactive> passed 1 test.
    ShelleyGovernanceCmdGenesisDelegationNotSupportedInConway: OK
        ✓ <interactive> passed 1 test.
  golden HelpAll:                                              OK (0.11s)
      ✓ Test.Golden.Help.hprop_golden_HelpAll passed 1 test.
  golden HelpCmds:                                             OK (11.17s)
      ✓ Test.Golden.Help.hprop_golden_HelpCmds passed 1 test.
  golden view byron:                                           OK (0.08s)
      ✓ Test.Golden.TxView.hprop_golden_view_byron passed 1 test.
  golden view shelley:                                         OK (0.12s)
      ✓ Test.Golden.TxView.hprop_golden_view_shelley passed 1 test.
  golden view allegra:                                         OK (0.08s)
      ✓ Test.Golden.TxView.hprop_golden_view_allegra passed 1 test.
  golden view mary:                                            OK (0.08s)
      ✓ Test.Golden.TxView.hprop_golden_view_mary passed 1 test.
  golden view alonzo:                                          OK (0.11s)
      ✓ Test.Golden.TxView.hprop_golden_view_alonzo passed 1 test.
  golden view alonzo signed:                                   OK (0.11s)
      ✓ Test.Golden.TxView.hprop_golden_view_alonzo_signed passed 1 test.
  golden version:                                              OK (0.04s)
      ✓ Test.Golden.Version.hprop_golden_version passed 1 test.

All 39 tests passed (12.11s)
Test suite cardano-cli-golden: PASS
Test suite logged to:
/Users/jky/wrk/iohk/cardano-cli/dist-newstyle/build/aarch64-osx/ghc-9.6.2/cardano-cli-8.4.1.0/t/cardano-cli-golden/test/cardano-cli-8.4.1.0-cardano-cli-golden.log
1 of 1 test suites (1 of 1 test cases) passed.
[~/wrk/iohk/cardano-cli]$ cabal test cardano-cli-test
Build profile: -w ghc-9.6.2 -O1
In order, the following will be built (use -v for more details):
 - cardano-cli-8.4.1.0 (test:cardano-cli-test) (ephemeral targets)
Preprocessing test suite 'cardano-cli-test' for cardano-cli-8.4.1.0..
Building test suite 'cardano-cli-test' for cardano-cli-8.4.1.0..
Running 1 test suites...
Test suite cardano-cli-test: RUNNING...
test/cardano-cli-test/cardano-cli-test.hs
  backwardsCompatibleCliFormat:              OK (0.11s)
      ✓ Test.Cli.CliIntermediateFormat.hprop_backwardsCompatibleCliFormat passed 1 test.
  createVRFSigningKeyFilePermissions:        OK (0.04s)
      ✓ Test.Cli.FilePermissions.hprop_createVRFSigningKeyFilePermissions passed 1 test.
  convertITNKeys:                            OK (0.08s)
      ✓ Test.Cli.ITN.hprop_convertITNKeys passed 1 test.
  convertITNExtendedSigningKey:              OK (0.04s)
      ✓ Test.Cli.ITN.hprop_convertITNExtendedSigningKey passed 1 test.
  convertITNBIP32SigningKey:                 OK (0.04s)
      ✓ Test.Cli.ITN.hprop_convertITNBIP32SigningKey passed 1 test.
  golden bech32Decode:                       OK
      ✓ Test.Cli.ITN.hprop_golden_bech32Decode passed 1 test.
  json roundtrip delegations and rewards:    OK (0.02s)
      ✓ Test.Cli.JSON.hprop_json_roundtrip_delegations_and_rewards passed 100 tests.
  roundtrip kes period info output JSON:     OK
      ✓ Test.Cli.JSON.hprop_roundtrip_kes_period_info_output_JSON passed 100 tests.
  roundtrip Value parse render:              OK
      ✓ Test.Cli.MultiAssetParsing.hprop_roundtrip_Value_parse_render passed 100 tests.
  roundtrip Value parse renderPretty:        OK
      ✓ Test.Cli.MultiAssetParsing.hprop_roundtrip_Value_parse_renderPretty passed 100 tests.
  buildShelleyPaymentAddress:                OK (0.08s)
      ✓ Test.Cli.Pioneers.Exercise1.hprop_buildShelleyPaymentAddress passed 1 test.
  buildShelleyStakeAddress:                  OK (0.13s)
      ✓ Test.Cli.Pioneers.Exercise1.hprop_buildShelleyStakeAddress passed 1 test.
  createTransaction:                         OK (0.13s)
      ✓ Test.Cli.Pioneers.Exercise2.hprop_createTransaction passed 1 test.
  createOperationalCertificate:              OK (0.12s)
      ✓ Test.Cli.Pioneers.Exercise3.hprop_createOperationalCertificate passed 1 test.
  createStakeAddressRegistrationCertificate: OK (0.08s)
      ✓ Test.Cli.Pioneers.Exercise4.hprop_createStakeAddressRegistrationCertificate passed 1 test.
  createLegacyZeroTxOutTransaction:          OK (0.13s)
      ✓ Test.Cli.Pioneers.Exercise5.hprop_createLegacyZeroTxOutTransaction passed 1 test.
  createZeroLovelaceTxOutTransaction:        OK (0.12s)
      ✓ Test.Cli.Pioneers.Exercise6.hprop_createZeroLovelaceTxOutTransaction passed 1 test.
  readFromPipe:                              OK
      ✓ Test.Cli.Pipes.hprop_readFromPipe passed 10 tests.
  percentage:                                OK
      ✓ Test.Cli.Shelley.Run.Query.hprop_percentage passed 1 test.
  configMainnetHash:                         OK (0.30s)
      ✓ Test.Config.Mainnet.hprop_configMainnetHash passed 1 test.
  configMainnetYaml:                         OK
      ✓ Test.Config.Mainnet.hprop_configMainnetYaml passed 1 test.

All 21 tests passed (1.45s)
Test suite cardano-cli-test: PASS
Test suite logged to:
/Users/jky/wrk/iohk/cardano-cli/dist-newstyle/build/aarch64-osx/ghc-9.6.2/cardano-cli-8.4.1.0/t/cardano-cli-test/test/cardano-cli-8.4.1.0-cardano-cli-test.log
1 of 1 test suites (1 of 1 test cases) passed.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • The change log section in the PR description has been filled in
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • The changelog section in the PR is updated to describe the change
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@newhoggy newhoggy marked this pull request as ready for review August 2, 2023 12:50
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch from df775c8 to f8feda6 Compare August 2, 2023 13:16
@newhoggy newhoggy requested review from carbolymer and Jimbo4350 and removed request for carbolymer August 2, 2023 13:17
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch 2 times, most recently from 63d9367 to 1263600 Compare August 2, 2023 14:03
-Wunused-packages

if impl(ghc >= 9.6)
ghc-options: -Wunused-packages
Copy link
Contributor

@carbolymer carbolymer Aug 2, 2023

Choose a reason for hiding this comment

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

Why >= 9.6 ? Tbh it's quite useful feature also on lower GHC versions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea. One of the packages gets flagged on ghc-8.10.7 but when I remove it, the compile fails. We still have it for ghc-9.6 so CI will catch it for us.

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

That's cool!

@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch from 1263600 to 86049bd Compare August 2, 2023 14:50
@newhoggy newhoggy enabled auto-merge August 2, 2023 14:58
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch 2 times, most recently from a5acb91 to 129ee55 Compare August 3, 2023 12:01
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch 3 times, most recently from f39feba to 3013081 Compare August 5, 2023 07:52
@newhoggy newhoggy requested review from a team as code owners August 5, 2023 08:16
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch 2 times, most recently from ddc21a6 to bb7ed14 Compare August 5, 2023 08:53
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch 2 times, most recently from 37fc767 to d3203c4 Compare August 5, 2023 09:20
@newhoggy newhoggy force-pushed the newhoggy/convert-to-use-tasty-discover branch from d3203c4 to f42c4fd Compare August 5, 2023 09:21
@andreabedini andreabedini mentioned this pull request Aug 7, 2023
10 tasks
@andreabedini
Copy link
Contributor

I think there is an issue with the derivation for blst. It's brought in like this:

/nix/store/3nkxnv4rnvcnyhq7i4djxkvqgrgbxj5r-cardano-cli-test-cardano-cli-golden-x86_64-w64-mingw32-8.5.0.0.drv
└───/nix/store/rfijsxhycjb5lflvbz3ihplb4r5fhs3m-cardano-cli-exe-cardano-cli-8.5.0.0.drv
    └───/nix/store/8hfn8bijkps5grr9jlpac7al8n405d8j-cardano-crypto-class-lib-cardano-crypto-class-2.1.2.0.drv
        └───/nix/store/8nfavjdpfyhs87k75zd23dadq2y9888n-blst-03b5124.drv

Note that, since cardano-cli-exe-cardano-cli is build-tool for cardano-cli-test-cardano-cli-golden, cardano-cli-exe-cardano-cli is not cross-compiled. But somehow blst gets compiled with

/build.sh flavour=mingw64\n./build.sh -shared flavour=mingw64

which fails because the build is not running under mingw64.

I opened input-output-hk/iohk-nix#551 hoping to fix this.

@andreabedini
Copy link
Contributor

Hydra is all 🟢 🥳

Copy link
Contributor

@andreabedini andreabedini left a comment

Choose a reason for hiding this comment

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

👍

@newhoggy newhoggy added this pull request to the merge queue Aug 8, 2023
Merged via the queue into main with commit a15309e Aug 8, 2023
@newhoggy newhoggy deleted the newhoggy/convert-to-use-tasty-discover branch August 8, 2023 07:17
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.

4 participants