Skip to content

Fix test-coverage CI failure: pin leiden deps in scverse env, surface covr test output - #3

Merged
mianaz merged 4 commits into
mainfrom
claude/fix-items-383z97
Aug 21, 2026
Merged

Fix test-coverage CI failure: pin leiden deps in scverse env, surface covr test output#3
mianaz merged 4 commits into
mainfrom
claude/fix-items-383z97

Conversation

@mianaz

@mianaz mianaz commented Aug 21, 2026

Copy link
Copy Markdown
Owner

The test-coverage job failed on PR #2 and on main after 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') in test-python-validation.R raised ImportError: Please install the igraph package. python-igraph is 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: pin python-igraph and leidenalg 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.
  • .github/workflows/test-coverage.yaml: covr's test phase writes results only to testthat.Rout.fail inside 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's install_path outside the R session tempdir (R deletes its own Rtmp* 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 --coverage builds drop into src/.

claude added 4 commits August 21, 2026 07:54
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
@mianaz mianaz changed the title Fix test-coverage CI failure (diagnostics first) Fix test-coverage CI failure: pin leiden deps in scverse env, surface covr test output Aug 21, 2026
@mianaz
mianaz merged commit e8565a9 into main Aug 21, 2026
7 checks passed
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.

2 participants