Skip to content

ci: run the unit, uv-contract and e2e suites on every PR - #138

Merged
asmacdo merged 3 commits into
con:study-first-rewritefrom
asmacdo:ci-tests
Sep 3, 2026
Merged

asmacdo merged 3 commits into
con:study-first-rewritefrom
asmacdo:ci-tests

Conversation

@asmacdo

@asmacdo asmacdo commented Sep 3, 2026

Copy link
Copy Markdown
Member

tldr:

  • new tests.yml with three jobs: unit (pytest, git-annex installed so nothing skips), uv-contract (pytest -m uv_build with a real uv), e2e (run_in_podman.sh in rootless podman on the hosted runner).
  • the e2e job seeds a ReproNim/containers clone + the simbids SIF (cached) and pulls slurm-docker-ci:0.14 as their own steps.
  • this PR is its own test: pull_request runs the workflow from the PR head, so the first run answers whether the image + SIF + campaign venv fit a hosted runner and whether rootless podman there allows the nested apptainer namespace.
Why three jobs

They need different things from the runner. Splitting them keeps a 45-second unit failure from waiting on a 20-minute e2e, and makes the e2e's infrastructure dependencies (image, container dataset) visible as their own steps rather than buried in one log.

Two workarounds in the e2e job
  • pull_request checks out a detached merge commit, and run_in_podman.sh refuses a detached HEAD because the campaign pin is URL@REF and git clone --branch takes a branch or tag. A step does git switch -c ci-under-test first.
  • The suite skips rather than fails when the simbids SIF is missing, so a failed seed would be a green job that ran nothing. The seed step ends with test -e on the SIF to make that red.
Deferred

The suite could take the containers dataset by URL for CI, with the local clone as an env-var override; then the seed step goes away. Left as a TODO comment on the step.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y

asmacdo and others added 3 commits September 3, 2026 11:49
Three jobs, split by what each needs from the runner: the unit suite wants only
git-annex (so the two annex-proving tests run instead of skipping), the
uv_build tests want a real uv, and the e2e wants the slurm-docker-ci image plus a
ReproNim/containers clone holding the simbids SIF.

Two things the e2e job has to work around: pull_request checks out a detached
merge commit and run_in_podman.sh refuses a detached HEAD (the campaign pin is a
branch or tag), so HEAD is put on a branch first; and the suite skips rather than
fails when the SIF is missing, so the seed step asserts the file exists to turn a
failed seed into a red job.

Whether the image + SIF + campaign venv fit a hosted runner, and whether rootless
podman there allows the nested apptainer namespace, is what the first run answers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
First run of con#138 reddened all three jobs on two causes.

Every suite commits — the unit tests build real datalad datasets, the e2e seeds a
git-annex clone — and a hosted runner has no git identity, so git refused with
"empty ident name" (3 unit failures in test_clean_check, the e2e seed dead in
`git annex init`). A workflow-level GIT_AUTHOR_*/GIT_COMMITTER_* env covers all
jobs in one place.

The uv_build test pins this checkout at `rev-parse --abbrev-ref HEAD`, which on a
detached pull_request checkout is the literal `HEAD`; uv then tried to fetch a
branch or tag named HEAD. The uv-contract job now puts HEAD on a branch first, as
the e2e job already did.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
uv (0.12.9) cannot resolve a branch out of a shallow repo: the fetch succeeds
but neither the branch nor the tag ref lands, and it reports "failed to find
branch or tag". The uv_build test pins this checkout as a git+file://…@<branch>
source, so the default depth-1 checkout broke it. Reproduced locally against a
`git clone --depth 1`; a full clone resolves fine, and the e2e job (already
fetch-depth 0) ran the same kind of `uv lock` green.

Also correct the timing comments to what the first green run measured: unit
~90 s, e2e ~6 min end to end.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pfazng8PuPvbQNN25uzK2Y
@asmacdo
asmacdo marked this pull request as ready for review September 3, 2026 17:19
@asmacdo
asmacdo merged commit fb4e1ba into con:study-first-rewrite Sep 3, 2026
4 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.

1 participant