From 31507b1f7bbb142881ad1cd254f3827bd6f7ef07 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 27 Aug 2024 13:11:43 +0100 Subject: [PATCH] ci: Fix --index-state for hackage roundtrip tests As a principle, tests which are required for CI to pass should be reproducible and not depending on external resources changes or being modified. The hackage tests currently violate this by depending on the latest index state from hackage. This is problematic because until the test is fixed all merges into master are blocked. Even though the patches in question have nothing to do with the test. It would be more suitable for a nightly job to run on the latest index and for normal CI to run with a fixed index which is updated periodically in a controlled manner. Fixes #10284 --- validate.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/validate.sh b/validate.sh index 47705300a2d..ff1c9e139a9 100755 --- a/validate.sh +++ b/validate.sh @@ -417,14 +417,18 @@ CMD="$($CABALLISTBIN Cabal-tests:test:rpmvercmp) $TESTSUITEJOBS --hide-successes CMD="$($CABALLISTBIN Cabal-tests:test:no-thunks-test) $TESTSUITEJOBS --hide-successes" (cd Cabal-tests && timed $CMD) || exit 1 + +# See #10284 for why this value is pinned. +HACKAGE_TESTS_INDEX_STATE="--index-state=2024-08-25" + CMD=$($CABALLISTBIN Cabal-tests:test:hackage-tests) -(cd Cabal-tests && timed $CMD read-fields) || exit 1 +(cd Cabal-tests && timed $CMD read-fields $HACKAGE_TESTS_INDEX_STATE) || exit 1 if $HACKAGETESTSALL; then - (cd Cabal-tests && timed $CMD parsec) || exit 1 - (cd Cabal-tests && timed $CMD roundtrip) || exit 1 + (cd Cabal-tests && timed $CMD parsec $HACKAGE_TESTS_INDEX_STATE) || exit 1 + (cd Cabal-tests && timed $CMD roundtrip $HACKAGE_TESTS_INDEX_STATE) || exit 1 else - (cd Cabal-tests && timed $CMD parsec d) || exit 1 - (cd Cabal-tests && timed $CMD roundtrip k) || exit 1 + (cd Cabal-tests && timed $CMD parsec d $HACKAGE_TESTS_INDEX_STATE) || exit 1 + (cd Cabal-tests && timed $CMD roundtrip k $HACKAGE_TESTS_INDEX_STATE) || exit 1 fi }