Repository navigation
Execute the cardano-cli at the process level - #1450
Merged
Merged
Conversation
newhoggy
requested review from
Jimbo4350,
dcoutts,
erikd,
intricate and
mrBliss
as code owners
July 14, 2020 00:18
newhoggy
force-pushed
the
execute-cardano-cli-as-process
branch
from
July 14, 2020 05:03
385740a to
c73820d
Compare
Jimbo4350
approved these changes
Jul 14, 2020
| maybeCardanoCli <- IO.lookupEnv "CARDANO_CLI" | ||
| case maybeCardanoCli of | ||
| Just cardanoCli -> IO.readProcess cardanoCli arguments "" | ||
| Nothing -> IO.readProcess "cabal" ("exec":"--":"cardano-cli":arguments) "" |
Contributor
Author
|
Thanks! |
Contributor
Author
|
bors merge |
Contributor
Build succeeded |
iohk-bors Bot
added a commit
that referenced
this pull request
Jul 15, 2020
1453: Replace address shell tests with hedgehog tests r=newhoggy a=newhoggy # 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 ``` Co-authored-by: John Ky <[email protected]>
newhoggy
added a commit
to IntersectMBO/cardano-api
that referenced
this pull request
May 23, 2023
1453: Replace address shell tests with hedgehog tests r=newhoggy a=newhoggy # Pre-requisite PRs IntersectMBO/cardano-node#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 ``` Co-authored-by: John Ky <[email protected]>
newhoggy
added a commit
to IntersectMBO/cardano-cli
that referenced
this pull request
May 24, 2023
1453: Replace address shell tests with hedgehog tests r=newhoggy a=newhoggy # Pre-requisite PRs IntersectMBO/cardano-node#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 ``` Co-authored-by: John Ky <[email protected]>
This file contains hidden or 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
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.
New
execCardanoCLIfunction which uses one of:$CARDANO_CLIif it is definedcabal exec -- cardano-cliotherwiseNew
workspacefunction which creates a temporary directory and cleans it up. The clean up is signalled by writing adonefile.The
Genesis.Createtest is modified to useexecCardanoCLIandworkspace.New dependency on
processlibrary.