Skip to content

Replace address shell tests with hedgehog tests - #1453

Merged
iohk-bors[bot] merged 8 commits into
masterfrom
replace-address-shell-tests-with-hedgehog-tests
Jul 15, 2020
Merged

iohk-bors[bot] merged 8 commits into
masterfrom
replace-address-shell-tests-with-hedgehog-tests

Conversation

@newhoggy

@newhoggy newhoggy commented Jul 14, 2020 •

Copy link
Copy Markdown
Contributor

Pre-requisite PRs

#1450

New tests

  • Address.Create
  • Address.KeyGen

New note functions

The new noteEval and noteEvalM functions can be used to annotate values that are evaluated or computed. This provides a good user experience for inspecting failed tests for example in the following test the filenames are displayed after lines 22 and 28 whilst stdout is display after lines 30 and 39

       ┏━━ test/Test/CLI/Shelley/Golden/Address/Build.hs ━━━
    16 ┃ golden_shelleyAddressBuild :: Property
    17 ┃ golden_shelleyAddressBuild = OP.propertyOnce $ OP.workspace "tmp/address-key-gen" $ \tempDir -> do
    18 ┃   addressVKeyFile <- OP.noteEvalM $ OP.newFileWithContents (tempDir <> "/address.vkey") "{\
    19 ┃     \    \"type\": \"PaymentVerificationKeyShelley\",\
    20 ┃     \    \"description\": \"Payment Verification Key\",\
    21 ┃     \    \"cborHex\": \"58208dc60533b5dfa60a530955a696323a2ef4f14e8bc95a8f84cf6c441fea423427\"\
    22 ┃     \}"
       ┃     │ "tmp/address-key-gen/test-9f98f97fdf26709f/address.vkey"
    23 ┃   addressSKeyFile <- OP.noteEvalM $ OP.newFileWithContents (tempDir <> "/address.skey") "\
    24 ┃     \{\
    25 ┃     \    \"type\": \"StakingVerificationKeyShelley\",\
    26 ┃     \    \"description\": \"Stake Verification Key\",\
    27 ┃     \    \"cborHex\": \"5820bd07998bca8de945482d950a3051f0e4d18afedecbc08d4c99c23f1804f3c8e5\"\
    28 ┃     \}"
       ┃     │ "tmp/address-key-gen/test-9f98f97fdf26709f/address.skey"
    29 ┃ 
    30 ┃   stackingAddressText <- OP.noteEvalM . liftIO $ OP.execCardanoCLI
       ┃   │ "addr_test1qpfqwx0t6v5d80f6gqaznkk676vph0wmt68lfera8am87f5pksj9lpze8a3uplezj6fsy48h0grfp75auhuknjkz0jcqqnm3zv\n"
    31 ┃     [ "shelley","address","build"
    32 ┃     , "--testnet-magic", "14"
    33 ┃     , "--payment-verification-key-file", addressVKeyFile
    34 ┃     , "--staking-verification-key-file", addressSKeyFile
    35 ┃     ]
    36 ┃ 
    37 ┃   length (L.lines stackingAddressText) === 1
    38 ┃ 
    39 ┃   enterpriseAddressText <- OP.noteEvalM . liftIO $ OP.execCardanoCLI
       ┃   │ "addr_test1qpfqwx0t6v5d80f6gqaznkk676vph0wmt68lfera8am87f5pksj9lpze8a3uplezj6fsy48h0grfp75auhuknjkz0jcqqnm3zv\n"
    40 ┃     [ "shelley","address","build"
    41 ┃     , "--testnet-magic", "14"
    42 ┃     , "--payment-verification-key-file", addressVKeyFile
    43 ┃     , "--staking-verification-key-file", addressSKeyFile
    44 ┃     ]
    45 ┃ 
    46 ┃   length (L.lines enterpriseAddressText) === 1
    47 ┃ 
    48 ┃   True === False
       ┃   ^^^^^^^^^^^^^^
       ┃   │ ━━━ Failed (- lhs) (+ rhs) ━━━
       ┃   │ - True
       ┃   │ + False

@newhoggy
newhoggy force-pushed the replace-address-shell-tests-with-hedgehog-tests branch from b0ffbc7 to 24552c3 Compare July 14, 2020 07:02

@Jimbo4350 Jimbo4350 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, a few comments though

@newhoggy
newhoggy force-pushed the replace-address-shell-tests-with-hedgehog-tests branch 2 times, most recently from f5b8ce7 to 0b31374 Compare July 14, 2020 23:41

@intricate intricate left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

@newhoggy
newhoggy force-pushed the replace-address-shell-tests-with-hedgehog-tests branch from ac0b33c to 66f4b2f Compare July 15, 2020 03:11
@newhoggy

Copy link
Copy Markdown
Contributor Author

bors merge

@iohk-bors

iohk-bors Bot commented Jul 15, 2020

Copy link
Copy Markdown
Contributor

@iohk-bors
iohk-bors Bot merged commit a8faa35 into master Jul 15, 2020
@iohk-bors
iohk-bors Bot deleted the replace-address-shell-tests-with-hedgehog-tests branch July 15, 2020 04:50
Jimbo4350 added a commit that referenced this pull request Oct 6, 2026
…ction commands

Point cardano-api (and cardano-rpc) at IntersectMBO/cardano-api@c9943eb3,
which is master after IntersectMBO/cardano-api#1328 (ouroboros-consensus
5.0, cardano-ledger-core 1.22) and IntersectMBO/cardano-api#1361 (the
Dijkstra sub-transaction API), replacing the input-output-hk fork pin.

Point cardano-cli at IntersectMBO/cardano-cli@c5062645, the head of
IntersectMBO/cardano-cli#1453 ("Add transaction sub-transaction commands
(Dijkstra)") on top of the 11.2 bounds update, so that the cardano-cli in
the build plan has the `dijkstra transaction sub-transaction` commands the
"Nested transaction swap" test needs. Previously the test could only run
with CARDANO_CLI pointing at a separate build of that PR, and a build
against the old ledger at that, since its `create-testnet-data` writes a
Dijkstra genesis without `minPoolMargin`.

With these pins both Dijkstra tests pass with no environment overrides.
The cardano-cli pin is temporary: replace it once #1453 is released.
Jimbo4350 added a commit that referenced this pull request Oct 9, 2026
…ction commands

Point cardano-api (and cardano-rpc) at IntersectMBO/cardano-api@c9943eb3,
which is master after IntersectMBO/cardano-api#1328 (ouroboros-consensus
5.0, cardano-ledger-core 1.22) and IntersectMBO/cardano-api#1361 (the
Dijkstra sub-transaction API), replacing the input-output-hk fork pin.

Point cardano-cli at IntersectMBO/cardano-cli@c5062645, the head of
IntersectMBO/cardano-cli#1453 ("Add transaction sub-transaction commands
(Dijkstra)") on top of the 11.2 bounds update, so that the cardano-cli in
the build plan has the `dijkstra transaction sub-transaction` commands the
"Nested transaction swap" test needs. Previously the test could only run
with CARDANO_CLI pointing at a separate build of that PR, and a build
against the old ledger at that, since its `create-testnet-data` writes a
Dijkstra genesis without `minPoolMargin`.

With these pins both Dijkstra tests pass with no environment overrides.
The cardano-cli pin is temporary: replace it once #1453 is released.
Jimbo4350 added a commit that referenced this pull request Oct 14, 2026
Add basic native and Plutus V4 script, staking, governance and top-level guard properties. Exercise direct and reference witnesses and missing required guards. Use cardano-api 11.9 and pin cardano-cli PR #1453 for the sub-transaction commands.
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