diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 0973de3..e447711 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -72,10 +72,32 @@ jobs: extra-packages: any::covr any::reticulate cache-version: 1 + # install_path must live outside the R session tempdir: R deletes its + # own Rtmp* directory when the process exits (clean = FALSE does not + # prevent that), which used to take testthat.Rout.fail with it. - name: Run test coverage shell: Rscript {0} run: | covr::codecov( quiet = FALSE, - clean = FALSE + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "covr-install") ) + + # covr runs the test suite via tools::testInstalledPackage, which writes + # test output only to testthat.Rout(.fail) inside its install library -- + # the job log otherwise shows nothing but "running the tests failed", + # making CI failures undiagnosable. Surface the file on failure. + - name: Show testthat output on failure + if: failure() + shell: bash + run: | + found=0 + while IFS= read -r f; do + found=1 + echo "=== $f ===" + tail -n 500 "$f" + done < <(find "$RUNNER_TEMP/covr-install" /tmp -name 'testthat.Rout*' 2>/dev/null) + if [ "$found" -eq 0 ]; then + echo "No testthat.Rout* files found" + fi diff --git a/.gitignore b/.gitignore index caea292..e381c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -85,3 +85,9 @@ inst/bin/scconvert inst/bin/scconvert.exe inst/bin/*.dll vignettes/cosmx_lung9 + +# gcov coverage artifacts (covr / --coverage builds) +src/*.gcda +src/*.gcno +src/cli_obj/*.gcda +src/cli_obj/*.gcno diff --git a/tests/scverse-env.yml b/tests/scverse-env.yml index 9e87a33..434ed87 100644 --- a/tests/scverse-env.yml +++ b/tests/scverse-env.yml @@ -8,6 +8,11 @@ dependencies: - squidpy>=1.3 - mudata>=0.2 - loompy>=3.0 + # sc.tl.leiden dependencies: conda-forge scanpy does not depend on these, + # so they must be pinned explicitly. They used to arrive transitively and + # vanished when the CI env cache expired and conda-forge re-solved. + - python-igraph + - leidenalg - numpy - pandas - scipy