Replace cabal test override with cooked-test commands#532
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #402.
Problem
The
defaultdev shell redefinedcabalas an exported bash function in itsshellHookto strip the verbose HPCWriting: ….htmloutput ofcabal test(coverage was enabled by default incabal.project). That function was exported withexport -f, so it was not inherited underdirenvwith shells other thanbash(e.g. zsh), and the noisy output reappeared.Changes
cabal.project: remove the default coverage settings (the redundantcoverage+ deprecatedlibrary-coveragefields). Coverage is now opt-in, so plaincabal testoutput is clean.flake.nix: replace the fragilecabalfunction override with two real scripts onPATHin thedefaultshell (work regardless of shell/direnv):cooked-test— runs the suite without coverage.cooked-test-coverage— runs with--enable-coverageand filters the verboseWriting: ….htmllines (preserving the real test exit status viaPIPESTATUS).Both remove a stale
spec.tixfirst to avoid HPC.tix/.mixhash mismatches (-fignore-hpc-changeslets GHC reuse instrumented objects across runs), and forward extra arguments to thetastytest binary (e.g.cooked-test -p "Balancing").Also removed a duplicate
pkgs.lmdbentry inLD_LIBRARY_PATH.CONTRIBUTING.md/CHANGELOG.md: documented the new commands and the default-coverage removal.Validation
nixfmthook passes;nix evalof thedefaultdev shell succeeds.cooked-test/cooked-test-coverageboth run, including with a-ppattern, and that alternating between them no longer triggers the HPC.tixmismatch.