Skip to content

Commit 1c25e5c

Browse files
committed
CI: pass proper test configuration matching top-level make test
The test job was running the testsuite directly (cd testsuite && make) without passing the configuration variables that the top-level 'make test' target provides. This caused: 1. Performance tests running and timing out (SKIP_PERF_TESTS was not set) 2. Missing lint flags (-dcore-lint, -dstg-lint, -dcmm-lint, etc.) 3. Missing tool paths (TEST_HC, GHC_PKG, HP2PS, HPC, RUNGHC) Fix by: - Building the testsuite timeout tool before running tests - Passing all the same variables as the Makefile's test target - Running 'make -C testsuite/tests test' (the actual test runner) - Splitting disk cleanup into its own step for clarity
1 parent b814c23 commit 1c25e5c

1 file changed

Lines changed: 30 additions & 12 deletions

File tree

.github/workflows/nix-ci.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,23 +394,41 @@ jobs:
394394
shell: bash
395395
run: ./mk/collect-metrics.sh start _build/metrics 0.5
396396

397+
- name: Free disk for tests
398+
run: |
399+
rm -rf .git
400+
find . -name .git -type d -exec rm -rf {} + 2>/dev/null || true
401+
rm -rf ~/.cabal-devx/packages/ 2>/dev/null || true
402+
df -h .
403+
404+
- name: Build testsuite timeout tool
405+
shell: devx {0}
406+
run: |
407+
set -eo pipefail
408+
make -C testsuite/timeout
409+
397410
- name: Run testsuite
398411
shell: devx {0}
399412
timeout-minutes: 120
400413
run: |
401414
set -eo pipefail
402-
# Free disk: remove .git (not needed for tests) and cabal index
403-
rm -rf .git
404-
find . -name .git -type d -exec rm -rf {} + 2>/dev/null || true
405-
rm -rf ~/.cabal-devx/packages/ 2>/dev/null || true
406-
# Run testsuite from checkout's testsuite/ directory with dist GHC on PATH.
407-
# Use THREADS=4 to match VM vCPU count (default is 1 = serial).
408-
cd testsuite
409-
PATH=$GITHUB_WORKSPACE/_build/dist/bin:$PATH \
410-
METRICS_FILE=$GITHUB_WORKSPACE/_build/test-perf.csv \
411-
SUMMARY_FILE=$GITHUB_WORKSPACE/_build/test-summary.txt \
412-
JUNIT_FILE=$GITHUB_WORKSPACE/_build/test-junit.xml \
413-
make THREADS=4
415+
DIST_BIN="$GITHUB_WORKSPACE/_build/dist/bin"
416+
# Pass the same variables the top-level 'make test' target uses.
417+
# SKIP_PERF_TESTS=YES prevents performance tests from running
418+
# (they timeout on CI). CANONICAL_TEST_HC_OPTS enables lint passes.
419+
TEST_HC="$DIST_BIN/ghc" \
420+
GHC_PKG="$DIST_BIN/ghc-pkg" \
421+
HP2PS_ABS="$DIST_BIN/hp2ps" \
422+
HPC="$DIST_BIN/hpc" \
423+
RUNGHC="$DIST_BIN/runghc" \
424+
TEST_CC="${CC:-cc}" \
425+
TEST_HC_OPTS="-dcore-lint -dstg-lint -dcmm-lint -no-user-package-db -fno-dump-with-ways -fprint-error-index-links=never -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -Werror=compat -dno-debug-output" \
426+
SKIP_PERF_TESTS=YES \
427+
THREADS=4 \
428+
METRICS_FILE="$GITHUB_WORKSPACE/_build/test-perf.csv" \
429+
SUMMARY_FILE="$GITHUB_WORKSPACE/_build/test-summary.txt" \
430+
JUNIT_FILE="$GITHUB_WORKSPACE/_build/test-junit.xml" \
431+
make -C testsuite/tests test
414432
415433
- name: Stop metrics collection
416434
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)