Skip to content

Fetch full history in CI and skip frozen-commit tests without it - #1

Merged
AxelNoun merged 1 commit into
masterfrom
fix/ci-full-history
Oct 10, 2026
Merged

AxelNoun merged 1 commit into
masterfrom
fix/ci-full-history

Conversation

@AxelNoun

@AxelNoun AxelNoun commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Problem

The tests workflow has failed on every push to master from 85ff1e9 onwards (three pushes on 27 Aug 2026: runs 33060297832, 33061204738 and 33062233765). In each run, the Python 3.11 job fails on the same three tests, and fail-fast cancels the 3.12 job:

  • tests/test_osf_deposit.py::test_snapshot_matches_pinned_hashes
  • tests/test_osf_deposit.py::test_manifest_points_at_the_freeze_not_head
  • tests/test_osf_deposit.py::test_write_bundle_matches_git

All three fail at git show 0a5e794…:PREREGISTRATION.md, which exits with status 128. actions/checkout@v4 fetches a single commit by default, so the frozen prereg-v1 commit is absent from the CI clone. The other tests pass (117 or 118, depending on the run).

Change

  • .github/workflows/tests.yml: fetch-depth: 0 on the checkout step, so that CI has the full history and runs the three tests.
  • tests/test_osf_deposit.py: the three tests that read the frozen commit are marked skipif when git cat-file -e 0a5e794…^{commit} fails in the current directory (shallow clone, release zip or tarball without .git, or git not installed). The skip reason names the commit. test_upload_refuses_an_empty_token does not depend on git and is unchanged.

src/, PREREGISTRATION.md, configs/prereg_v1.json and the pinned hashes in osf_deposit.FROZEN_SHA256 are not modified.

Checks run locally

Windows, pytest 9.1.1, Python 3.12.11 (numpy 2.5.3, scipy 1.18.1, ripser 0.6.15) and Python 3.11.15 (numpy 2.4.6, scipy 1.17.1, ripser 0.6.15).

Checkout Command 3.12 3.11
full clone of this branch pytest -q 121 passed 121 passed
git clone --depth 1 of this branch pytest -q -rs 118 passed, 3 skipped (the three tests above) 118 passed, 3 skipped
git archive --format=zip of this branch, extracted pytest -q -rs tests/test_osf_deposit.py 1 passed, 3 skipped not run
depth-1 clone with the test file from master (control) pytest -q on that file 3 failed, 1 passed, with the CI error not run

The workflow itself was not run locally. In CI on this branch (run 37610801711, commit ba71cc1), both pytest (3.11) and pytest (3.12) report 121 passed and none skipped.

With the skip, a checkout that lacks the frozen commit reports three skipped tests instead of three failures. Consequently, if fetch-depth: 0 were removed later, CI would report these skips rather than fail.

actions/checkout fetched depth 1, so test_osf_deposit could not read 0a5e794 and CI has failed since 85ff1e9. A shallow clone or release archive now reports the three tests as skipped instead of failed. No frozen prereg-v1 file or threshold is touched.
@AxelNoun
AxelNoun merged commit 9f254e7 into master Oct 10, 2026
4 checks passed
@AxelNoun
AxelNoun deleted the fix/ci-full-history branch October 10, 2026 14:53
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.

1 participant