Skip to content

Replace cabal test override with cooked-test commands#532

Merged
mmontin merged 1 commit into
mainfrom
mm/test-coverage-command
Jun 27, 2026
Merged

Replace cabal test override with cooked-test commands#532
mmontin merged 1 commit into
mainfrom
mm/test-coverage-command

Conversation

@mmontin

@mmontin mmontin commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Closes #402.

Problem

The default dev shell redefined cabal as an exported bash function in its shellHook to strip the verbose HPC Writing: ….html output of cabal test (coverage was enabled by default in cabal.project). That function was exported with export -f, so it was not inherited under direnv with shells other than bash (e.g. zsh), and the noisy output reappeared.

Changes

  • cabal.project: remove the default coverage settings (the redundant coverage + deprecated library-coverage fields). Coverage is now opt-in, so plain cabal test output is clean.

  • flake.nix: replace the fragile cabal function override with two real scripts on PATH in the default shell (work regardless of shell/direnv):

    • cooked-test — runs the suite without coverage.
    • cooked-test-coverage — runs with --enable-coverage and filters the verbose Writing: ….html lines (preserving the real test exit status via PIPESTATUS).

    Both remove a stale spec.tix first to avoid HPC .tix/.mix hash mismatches (-fignore-hpc-changes lets GHC reuse instrumented objects across runs), and forward extra arguments to the tasty test binary (e.g. cooked-test -p "Balancing").

  • Also removed a duplicate pkgs.lmdb entry in LD_LIBRARY_PATH.

  • CONTRIBUTING.md / CHANGELOG.md: documented the new commands and the default-coverage removal.

Validation

  • Pre-commit nixfmt hook passes; nix eval of the default dev shell succeeds.
  • Verified cooked-test / cooked-test-coverage both run, including with a -p pattern, and that alternating between them no longer triggers the HPC .tix mismatch.

Test coverage was enabled by default in 'cabal.project' (the redundant
'coverage'/'library-coverage' fields), which cluttered 'cabal test' output
with many 'Writing: ....html' lines. The 'default' dev shell worked around
this by redefining 'cabal' as an exported bash function, which did not work
under direnv with shells other than bash (e.g. zsh).

Remove the default coverage settings and replace the fragile 'cabal'
override with two real scripts on PATH that work regardless of shell:
'cooked-test' runs the suite (no coverage, clean output) and
'cooked-test-coverage' runs it with '--enable-coverage'. Update
CONTRIBUTING.md and CHANGELOG.md accordingly.

Closes #402

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mmontin
mmontin merged commit 642d64a into main Jun 27, 2026
8 checks passed
@mmontin
mmontin deleted the mm/test-coverage-command branch June 27, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the cabal test all command to hide verbose output

1 participant