Skip to content

Commit 9144661

Browse files
authored
Fix nightly CI process (#2208)
Just some simple fixes to the nightly ci: - Actually run the blockfrost tests 😅 instead of skipping - Make the AWS S3 tests only run nightly (mostly just to indicate how) Fixes #2191 --- <!-- Consider each and tick it off one way or the other --> * [x] CHANGELOG updated or not needed * [x] Documentation updated or not needed * [x] Haddocks updated or not needed * [x] No new TODOs introduced or explained herafter
2 parents 89a6f4e + b367963 commit 9144661

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.github/workflows/nightly-ci.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,30 @@ jobs:
4040
export HYDRA_BACKEND="blockfrost"
4141
nix build .#${{ matrix.package }}-tests
4242
nix develop
43-
cabal test hydra-cluster --test-options '-m "End-to-end on Cardano devnet"'
43+
cabal test --test-options '-m "End-to-end on Cardano devnet"'
4444
else
4545
echo "::warning file=blockfrost-project.txt,title=BLOCKFROST::Missing blockfrost project file."
4646
fi
47+
48+
49+
other-nightly-tests:
50+
name: "Nightly tests"
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
include:
55+
- package: hydra-plutus
56+
- package: hydra-tx
57+
- package: hydra-chain-observer
58+
- package: hydra-node
59+
- package: hydra-cluster
60+
# Note: Missing hydra-tui
61+
62+
- name: Nightly tests
63+
env:
64+
CI_NIGHTLY: True
65+
run: |
66+
cd ${{ matrix.package }}
67+
nix build .#${{ matrix.package }}-tests
68+
nix develop
69+
cabal test --test-options '-m "@nightly"'

hydra-node/test/Hydra/Events/S3Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Hydra.Events.S3 (fromObjectKey, newS3EventStore, purgeEvents, toObjectKey
1212
import Test.QuickCheck (chooseBoundedIntegral, counterexample, forAllShrink, ioProperty, sized, sublistOf, withMaxSuccess, (===))
1313

1414
spec :: Spec
15-
spec = do
15+
spec = around_ onlyNightly $ describe "AWS S3 @nightly" $ do
1616
prop "ObjectKey <-> EventId" $ \eventId ->
1717
let key = toObjectKey eventId
1818
in fromObjectKey @(Either String) key === Right eventId

hydra-test-utils/src/Test/Hydra/Prelude.hs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module Test.Hydra.Prelude (
1515
checkProcessHasNotDied,
1616
exceptionContaining,
1717
withClearedPATH,
18+
onlyNightly,
1819
) where
1920

2021
import Hydra.Prelude
@@ -206,3 +207,17 @@ withClearedPATH act =
206207
env <- getEnv "PATH"
207208
setEnv "PATH" ""
208209
pure env
210+
211+
-- | Only run this task when the CI_NIGHTLY environment variable is set (to
212+
-- anything).
213+
--
214+
-- If you're using this, you want to tag the test with `@nightly` as well;
215+
-- like:
216+
--
217+
-- spec = around_ onlyNightly $ describe "... @nightly" $ do
218+
-- ...
219+
onlyNightly :: IO () -> IO ()
220+
onlyNightly action = do
221+
lookupEnv "CI_NIGHTLY" >>= \case
222+
Nothing -> pendingWith "Only runs nightly"
223+
Just _ -> action

0 commit comments

Comments
 (0)