Skip to content

Commit

Permalink
ci: Fix --index-state for hackage roundtrip tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mpickering committed Aug 27, 2024
1 parent 8e4d167 commit 31507b1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 31507b1

Please sign in to comment.