Skip to content

Commit

Permalink
Merge pull request #1250 from input-output-hk/dependabot/github_actio…
Browse files Browse the repository at this point in the history
…ns/cachix/install-nix-action-25

Use shorter temp directory names and bump cachix/install-nix-action from 23 to 25
  • Loading branch information
ch1bo authored Jan 23, 2024
2 parents 9c7d20f + d096d25 commit 148a0c3
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cardano-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ref: 8.7.2

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
ref: 170817f5ba3f7838ffd9bd181bc30504906a6506

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
submodules: true

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
Expand Down
2 changes: 1 addition & 1 deletion hydra-cluster/test/Test/CardanoClientSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec =
around (showLogsOnFailure "CardanoClientSpec") $
it "queryGenesisParameters works as expected" $ \tracer ->
failAfter 60 $
withClusterTempDir "queryGenesisParameters" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
-- This uses the hydra-cluster/config/devnet and updates the
-- systemStart to some current time making it the perfect target to
-- test against.
Expand Down
2 changes: 1 addition & 1 deletion hydra-cluster/test/Test/ChainObserverSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec = do
it "can observe hydra transactions created by hydra-nodes" $
failAfter 60 $
showLogsOnFailure "ChainObserverSpec" $ \tracer -> do
withTempDir "hydra-chain-observer" $ \tmpDir -> do
withTempDir "hydra-cluster" $ \tmpDir -> do
-- Start a cardano devnet
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \cardanoNode@RunningNode{nodeSocket} -> do
-- Prepare a hydra-node
Expand Down
6 changes: 3 additions & 3 deletions hydra-cluster/test/Test/DirectChainSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do
waitForUTxO networkId nodeSocket someUTxO

it "can restart head to point in the past and replay on-chain events" $ \tracer -> do
withTempDir "direct-chain" $ \tmp -> do
withTempDir "hydra-cluster" $ \tmp -> do
withCardanoNodeDevnet (contramap FromNode tracer) tmp $ \node@RunningNode{nodeSocket, networkId} -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
(aliceCardanoVk, _) <- keysFor Alice
Expand All @@ -331,7 +331,7 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do
void $ aliceChain `observesInTimeSatisfying` hasInitTxWith headParameters participants

it "cannot restart head to an unknown point" $ \tracer -> do
withTempDir "direct-chain" $ \tmp -> do
withTempDir "hydra-cluster" $ \tmp -> do
withCardanoNodeDevnet (contramap FromNode tracer) tmp $ \node@RunningNode{nodeSocket} -> do
(aliceCardanoVk, _) <- keysFor Alice
seedFromFaucet_ node aliceCardanoVk 100_000_000 (contramap FromFaucet tracer)
Expand All @@ -349,7 +349,7 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do
IntersectionNotFound{} -> True

it "can publish and query reference scripts in a timely manner" $ \tracer -> do
withTempDir "direct-chain" $ \tmp -> do
withTempDir "hydra-cluster" $ \tmp -> do
withCardanoNodeDevnet (contramap FromNode tracer) tmp $ \RunningNode{nodeSocket, networkId} -> do
readConfigFile ("credentials" </> "faucet.sk") >>= writeFileBS (tmp </> "faucet.sk")
hydraScriptsTxIdStr <-
Expand Down
61 changes: 30 additions & 31 deletions hydra-cluster/test/Test/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,17 @@ import Prelude qualified
allNodeIds :: [Int]
allNodeIds = [1 .. 3]

-- | Like 'withTempDir', busing a common prefix to keep hydra-cluster logs more
-- easily on CI.
-- | Like 'withTempDir', but using a common template to archive logs more easily
-- on CI.
--
-- NOTE: The ci-nix.yaml workflow depends on this.
withClusterTempDir :: MonadIO m => String -> (FilePath -> m a) -> m a
withClusterTempDir name =
withTempDir ("hydra-cluster-e2e-" <> name)
withClusterTempDir :: MonadIO m => (FilePath -> m a) -> m a
withClusterTempDir = withTempDir "hydra-cluster"

spec :: Spec
spec = around (showLogsOnFailure "EndToEndSpec") $ do
it "End-to-end offline mode" $ \tracer -> do
withTempDir "offline-mode-e2e" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
(aliceCardanoVk, aliceCardanoSk) <- keysFor Alice
(bobCardanoVk, _) <- keysFor Bob
initialUTxO <- generate $ do
Expand Down Expand Up @@ -164,59 +163,59 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
describe "End-to-end on Cardano devnet" $ do
describe "single party hydra head" $ do
it "full head life-cycle" $ \tracer -> do
withClusterTempDir "single-full-life-cycle" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= singlePartyHeadFullLifeCycle tracer tmpDir node
it "can close with long deadline" $ \tracer -> do
withClusterTempDir "close-long-deadline" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= canCloseWithLongContestationPeriod tracer tmpDir node
it "can submit a timed tx" $ \tracer -> do
withClusterTempDir "timed-tx" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= timedTx tmpDir tracer node
it "commits from external with script utxo" $ \tracer -> do
withClusterTempDir "single-commits-script-from-external" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= singlePartyCommitsFromExternalScript tracer tmpDir node
it "commit external wallet utxo with inline datum in the script" $ \tracer -> do
withClusterTempDir "single-commits-script-from-external" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= singlePartyCommitsExternalScriptWithInlineDatum tracer tmpDir node
it "can't commit externally with internal wallet utxo" $ \tracer -> do
withClusterTempDir "commit-internal-wallet-utxo" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= singlePartyCannotCommitExternallyWalletUtxo tracer tmpDir node
it "can submit a signed user transaction" $ \tracer -> do
withClusterTempDir "submit-a-signed-user-transaction" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= canSubmitTransactionThroughAPI tracer tmpDir node

describe "three hydra nodes scenario" $ do
it "does not error when all nodes open the head concurrently" $ \tracer ->
failAfter 60 $
withClusterTempDir "three-no-errors" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node -> do
publishHydraScriptsAs node Faucet
>>= threeNodesNoErrorsOnOpen tracer tmpDir node

it "inits a Head, processes a single Cardano transaction and closes it again" $ \tracer ->
failAfter 60 $
withClusterTempDir "three-full-life-cycle" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
initAndClose tmpDir tracer 1 hydraScriptsTxId node

it "inits a Head and closes it immediately" $ \tracer ->
failAfter 60 $
withClusterTempDir "three-init-close-immediately" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
let clusterIx = 0
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node@RunningNode{nodeSocket} -> do
aliceKeys@(aliceCardanoVk, _) <- generate genKeyPair
Expand Down Expand Up @@ -279,25 +278,25 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

describe "restarting nodes" $ do
it "can abort head after restart" $ \tracer -> do
withClusterTempDir "abort-after-restart" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= restartedNodeCanAbort tracer tmpDir node

it "can observe a commit tx after a restart, even when a tx happened while down" $ \tracer -> do
withClusterTempDir "commit-after-restart" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= restartedNodeCanObserveCommitTx tracer tmpDir node

it "prevent resuming a head after reconfiguring a peer" $ \tracer -> do
withClusterTempDir "prevent-resume-reconfiguring-peer" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node ->
publishHydraScriptsAs node Faucet
>>= testPreventResumeReconfiguredPeer tracer tmpDir node

it "can start chain from the past and replay on-chain events" $ \tracer ->
withClusterTempDir "replay-chain-events" $ \tmp ->
withClusterTempDir $ \tmp ->
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmp $ \node@RunningNode{nodeSocket, networkId} -> do
(aliceCardanoVk, _aliceCardanoSk) <- keysFor Alice
let contestationPeriod = UnsafeContestationPeriod 10
Expand Down Expand Up @@ -325,7 +324,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
headId' `shouldBe` aliceHeadId

it "close of an initial snapshot from re-initialized node is contested" $ \tracer ->
withClusterTempDir "contest-after-restart" $ \tmp ->
withClusterTempDir $ \tmp ->
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmp $ \node@RunningNode{nodeSocket, networkId} -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet

Expand Down Expand Up @@ -407,7 +406,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
describe "two hydra heads scenario" $ do
it "two heads on the same network do not conflict" $ \tracer ->
failAfter 60 $
withClusterTempDir "two-heads-no-conflict" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
concurrently_
Expand All @@ -416,14 +415,14 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

it "alice inits a Head with incorrect keys preventing bob from observing InitTx" $ \tracer ->
failAfter 60 $
withClusterTempDir "incorrect-cardano-keys" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node -> do
publishHydraScriptsAs node Faucet
>>= initWithWrongKeys tmpDir tracer node

it "bob cannot abort alice's head" $ \tracer -> do
failAfter 60 $
withClusterTempDir "two-heads-cant-abort" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node@RunningNode{nodeSocket} -> do
(aliceCardanoVk, _aliceCardanoSk) <- keysFor Alice
(bobCardanoVk, _bobCardanoSk) <- keysFor Bob
Expand Down Expand Up @@ -457,7 +456,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

describe "Monitoring" $ do
it "Node exposes Prometheus metrics on port 6001" $ \tracer -> do
withClusterTempDir "prometheus-metrics" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
(aliceCardanoVk, _) <- keysFor Alice
withCardanoNodeDevnet (contramap FromCardanoNode tracer) tmpDir $ \node@RunningNode{nodeSocket} -> do
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
Expand All @@ -480,7 +479,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

describe "hydra-node executable" $ do
it "logs its command line arguments" $ \tracer -> do
withClusterTempDir "logs-options" $ \dir -> do
withClusterTempDir $ \dir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) dir $ \node@RunningNode{nodeSocket} -> do
let hydraTracer = contramap FromHydraNode tracer
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
Expand All @@ -490,7 +489,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
line ^? key "message" . key "tag" == Just (Aeson.String "NodeOptions")

it "logs to a logfile" $ \tracer -> do
withClusterTempDir "logs-to-logfile" $ \dir -> do
withClusterTempDir $ \dir -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) dir $ \node@RunningNode{nodeSocket} -> do
let hydraTracer = contramap FromHydraNode tracer
hydraScriptsTxId <- publishHydraScriptsAs node Faucet
Expand All @@ -507,7 +506,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
describe "forking eras" $ do
it "does report on unsupported era" $ \tracer -> do
pendingWith "Currently supporting Conway era no future upcoming"
withClusterTempDir "unsupported-era" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
args <- setupCardanoDevnet tmpDir
forkIntoConwayInEpoch tmpDir args 1
withCardanoNode (contramap FromCardanoNode tracer) tmpDir args $ \node@RunningNode{nodeSocket} -> do
Expand All @@ -527,7 +526,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do

it "does report on unsupported era on startup" $ \tracer -> do
pendingWith "Currently supporting Conway era no future upcoming"
withClusterTempDir "unsupported-era-startup" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
args <- setupCardanoDevnet tmpDir
forkIntoConwayInEpoch tmpDir args 1
withCardanoNode (contramap FromCardanoNode tracer) tmpDir args $ \node@RunningNode{nodeSocket} -> do
Expand All @@ -544,7 +543,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
errorOutputs `shouldContain` "upgrade your hydra-node"

it "support new era" $ \tracer -> do
withClusterTempDir "support-new-era" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
args <- setupCardanoDevnet tmpDir

forkIntoConwayInEpoch tmpDir args 10
Expand Down Expand Up @@ -580,7 +579,7 @@ spec = around (showLogsOnFailure "EndToEndSpec") $ do
guard $ snapshotNumber == Aeson.Number 0

it "support new era on restart" $ \tracer -> do
withClusterTempDir "support-new-era-restart" $ \tmpDir -> do
withClusterTempDir $ \tmpDir -> do
args <- setupCardanoDevnet tmpDir

forkIntoConwayInEpoch tmpDir args 10
Expand Down
4 changes: 2 additions & 2 deletions hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec :: Spec
spec =
describe "cardano-cli" $ do
it "cardano-cli can accept a draft commit tx in text-envelope format" $
withTempDir "cardano-cli" $ \tmpDir -> do
withTempDir "hydra-cluster" $ \tmpDir -> do
let txFile = tmpDir </> "tx.raw"
draftCommitResponse <- DraftCommitTxResponse <$> generate (arbitrary :: Gen Tx)
encodeFile txFile draftCommitResponse
Expand All @@ -40,7 +40,7 @@ spec =

around (showLogsOnFailure "CardanoCliSpec") $ do
it "query protocol-parameters is compatible with our FromJSON instance" $ \tracer ->
withTempDir "cardano-cli-pparams" $ \tmpDir -> do
withTempDir "hydra-cluster" $ \tmpDir -> do
withCardanoNodeDevnet tracer tmpDir $ \RunningNode{nodeSocket, networkId} -> do
protocolParameters <- cliQueryProtocolParameters nodeSocket (networkId)
case (parseEither pparamsFromJson protocolParameters) of
Expand Down
Loading

0 comments on commit 148a0c3

Please sign in to comment.