Skip to content

test: give t/ its own git identity and run the whole tree in CI - #206

Merged
mizchi merged 1 commit into
mainfrom
claude/modest-dirac-kceqee
Sep 21, 2026
Merged

mizchi merged 1 commit into
mainfrom
claude/modest-dirac-kceqee

Conversation

@mizchi

@mizchi mizchi commented Sep 21, 2026

Copy link
Copy Markdown
Member

Fixes #202
Fixes #204

These two are coupled — #202 is what made the workflow need a manual setup step, and dropping that step is part of #204's cleanup — so they land together.

#202: the harness supplies no git identity

t/test-lib.sh left the identity to whoever ran the tests. Several tests commit without configuring one per repository, so on a machine with no global identity — a fresh runner, a container — they died with unable to auto-detect email address. .github/workflows/t9-suite.yml worked around it with a git config --global step, which meant the suite could not be run anywhere else without the same manual setup.

t/test-lib.sh now points HOME at its own trash directory and writes a .gitconfig there.

Why a global config file rather than GIT_AUTHOR_* / GIT_COMMITTER_*:

  • those env vars outrank repository config, so they would silently override the many tests that set git config user.email in their own repositories. A global file keeps the normal precedence — a per-repository setting still wins.
  • redirecting HOME also stops a developer's real ~/.gitconfig from leaking into a run, which is its own source of "passes here, fails there".

GIT_CONFIG_GLOBAL would work too, but is a newer git feature; a plain HOME redirect has no version floor. t/test-lib-e2e.sh (used by 28 of the 30 t0xxx files) already did the equivalent, so this brings the two libs in line.

#204: t0xxx has no CI job

#201 gave t9 a job; the only task touching t/ filtered on t9, so the 30 t0xxx files still had no CI job at all — the same structural blind spot that let t9014 and t90010 stay red for months (#191) and a t9007 assertion never pass since #139 (#196).

  • Taskfile.pkl: test-subdir → test-t, running bash t/run-tests.sh unfiltered. A filter is precisely how this went wrong twice; there is no longer one to get stale.
  • .github/workflows/t9-suite.yml → t-suite.yml, job t9-suite → t-suite, since it is no longer t9-specific.
  • the Configure git identity step is removed — redundant after the t/test-lib.sh sets no git identity, so the suite depends on the developer's global config #202 fix, and its absence is what proves the fix.
  • docs/git-compatibility.md and t/README.md updated.

Scope note

#204 describes the range as t0 + t9. The tree actually holds five ranges: t0 (30), t1 (1), t3 (10), t7 (1), t9 (21) = 63 files. t1/t3/t7 were equally uncovered and all pass, so running unfiltered picks them up rather than leaving three more ranges to be noticed later.

The two concerns #204 raised

Job duration. All 63 files run in 54s locally against a prebuilt binary. The t9 job's ~14 minutes is almost entirely the release build that deps { build } triggers, and that is paid once either way — the extra 42 files add well under a minute. timeout-minutes: 90 is left as is.

Flakiness of the randomized tests. t0011/t0012/t0013/t0015 are not actually random: each drives a seeded LCG (LCG_STATE="$seed") from fixed seeds — seed=1,2,3 for t0011, seed=101… for t0012. The op sequences are reproducible run to run, so there is no timing-dependent flake to separate out and no reason to split the job.

Verification

Run under env -i with a fresh empty HOME and no git identity configured anywhere — no git config --global, unlike the run in #204 which still set the two lines the old workflow did. This is the stricter check: it exercises the #202 fix and the #204 widening at once.

FRESH=$(mktemp -d)
env -i PATH="$PATH" HOME="$FRESH" bash -c 'cd /home/user/bit && bash t/run-tests.sh'
========================================
Total:  63
Passed: 63
Failed: 0
========================================

pkl/pkf are not installed in this environment, so Taskfile.pkl could not be evaluated locally; the change is a rename of a local binding plus two string values, and CI will evaluate it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB


Generated by Claude Code

Two coupled gaps in the t/ harness.

The suite supplied no git identity of its own. t/test-lib.sh left it to
whoever ran the tests, and several tests commit without configuring one
per repository, so on a machine with no global identity — a fresh
runner, a container — they died with "unable to auto-detect email
address". .github/workflows/t9-suite.yml papered over that with a
`git config --global` step, which meant the suite could not be run
anywhere else without the same manual setup.

t/test-lib.sh now points HOME at its own trash directory and writes a
.gitconfig there. A global config file rather than GIT_AUTHOR_* /
GIT_COMMITTER_*: those env vars outrank repository config and would
silently override the many tests that set `git config user.email` in
their own repositories, whereas a global file keeps the normal
precedence. Redirecting HOME also stops a developer's real ~/.gitconfig
from leaking into a run. t/test-lib-e2e.sh already did the equivalent.

That unblocks the second gap: the only task touching t/ filtered on
`t9`, so the 30 t0xxx files had no CI job at all — the same structural
blind spot that let t9014, t90010 and a t9007 assertion sit broken for
months. The task now runs the tree unfiltered and is renamed test-t,
with the workflow renamed to match and its identity step dropped as
redundant.

All 63 files (t0 30, t1 1, t3 10, t7 1, t9 21) pass under
`env -i` with an empty HOME and no git identity configured anywhere, in
54s against a prebuilt binary — the job's ~14 minutes is the release
build, which is paid once either way. The t0011/t0012/t0013/t0015
"random" tests drive a seeded LCG from fixed seeds, so they are
deterministic and carry no flake risk.

Fixes #202
Fixes #204

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB
@mizchi
mizchi merged commit d0e38bd into main Sep 21, 2026
23 checks passed
@mizchi
mizchi deleted the claude/modest-dirac-kceqee branch September 21, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants