Fix test-coverage CI failure: pin leiden deps in scverse env, surface covr test output - #3
Merged
Merged
Conversation
covr's test phase (tools::testInstalledPackage) writes test results only to testthat.Rout.fail inside its temporary library; the job log shows nothing beyond 'running the tests in testthat.R failed', so coverage failures cannot be diagnosed from CI. Dump the file into the log when the job fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AB3bYjhyFftW5pXgRXDs27
covr / --coverage builds drop .gcda/.gcno files into src/, which showed up as untracked churn after running the coverage recipe locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AB3bYjhyFftW5pXgRXDs27
R removes its own Rtmp* directory when the Rscript process exits -- clean = FALSE does not prevent that -- so testthat.Rout.fail was gone before the failure-diagnostics step could print it. Pin install_path to RUNNER_TEMP/covr-install so the test output survives the failing step. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AB3bYjhyFftW5pXgRXDs27
The coverage job's two failures were sc.tl.leiden(flavor='igraph') raising ImportError: python-igraph is not a dependency of conda-forge scanpy, so it only ever arrived transitively. When the micromamba env cache (unused since June) expired, the fresh conda-forge solve dropped it and both leiden-based python-validation tests broke -- 976 of 978 tests passed, so nothing in the package itself was at fault. Pin the leiden backends explicitly; the env-file hash change also busts the stale cache. Verified locally: a fresh micromamba solve of this env file runs the exact failing leiden calls cleanly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AB3bYjhyFftW5pXgRXDs27
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.
The
test-coveragejob failed on PR #2 and onmainafter the merge, while all six R-CMD-check matrix jobs (including ubuntu-latest / R release — the same OS and R version as coverage) and pkgdown passed.Root cause
sc.tl.leiden(flavor='igraph')intest-python-validation.RraisedImportError: Please install the igraph package.python-igraphis not a dependency of conda-forge scanpy — it had only ever arrived in the CI env transitively. The micromamba env cache (last used June 26) expired, today's fresh conda-forge solve dropped it, and both leiden-based tests broke. 976 of 978 tests passed on the runner — nothing in the merged package changes was at fault; the timing was coincidental cache expiry.Changes
tests/scverse-env.yml: pinpython-igraphandleidenalgexplicitly. The env-file hash change also busts the stale cache. Verified locally: a fresh micromamba solve of this env file runs the exact failing leiden calls cleanly..github/workflows/test-coverage.yaml: covr's test phase writes results only totestthat.Rout.failinside its install library, and the job log showed nothing beyond "running the tests failed" — the failure was undiagnosable from CI. The workflow now pins covr'sinstall_pathoutside the R session tempdir (R deletes its ownRtmp*dir on exit, which was destroying the file) and prints the file on failure. This is what surfaced the root cause..gitignore: ignore gcov artifacts (.gcda/.gcno) that--coveragebuilds drop intosrc/.