Skip to content

Record story-116 in the story table #429

Record story-116 in the story table

Record story-116 in the story table #429

Workflow file for this run

name: tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
# One failing version must not cancel the others. Twice now a single
# transient `git clone` failure inside the clean-clone check has taken
# the whole matrix down, and on the first occurrence a job that had
# already reported "1257 passed" was marked failed because it was
# cancelled mid-cleanup — which made one flake read as three. Letting
# every version finish is what distinguishes an environment failure
# from a real one, and that distinction is the reason to run three.
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
# Full history, not the default shallow clone. story-053 converted
# every module that resolved this repository's history for an *input*
# onto committed fixtures under tests/history-fixtures/, so this is no
# longer load-bearing for those. It still is for the modules whose
# subject genuinely is what a past commit did — the entries
# tests/test_baseline_honesty.py declares as history readers rather
# than pending conversion, currently test_baseline_honesty.py,
# test_baseline_resolution_is_single.py, test_git_history_loading_retired.py
# and test_validation_module_naming.py. A one-commit checkout has no
# revision older than the change under test, so those go red.
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Install from the tracked declaration rather than a hand-listed set, so
# the plugin the configured test_command needs cannot be missing here
# while present locally.
- run: pip install -r requirements-dev.txt
# One retry, of the failures only, and only here. It was added while the
# clean-clone and revert checks still cloned with `--no-hardlinks`, which
# copies .git/objects as a directory tree: git enumerates the tree, then
# copies it, and three CI runs failed because a file vanished in between.
# One named objects/pack/multi-pack-index.lock, which exists only while
# something is writing a multi-pack index in the *source* repository.
#
# story-033 removed that cause. Both checks now clone over git's normal
# transport (`--no-local`), which negotiates a pack over a pipe and never
# reads the source's object files at all, so a concurrent writer in the
# source cannot reach the clone. The failure this step was added for is
# impossible rather than unlikely, and no call site is outstanding.
#
# The step stays anyway, for the reason it always named as its second
# purpose: the next unknown. It is not evidence of a known flake, and a
# green job that used it still says so below.
#
# The retry lives here rather than in orchestration/ deliberately. A
# harness that retries its own clone behaves differently depending on
# where it runs, and a developer running the suite locally should see
# the failure rather than a green run that quietly needed two attempts.
# So the harness is unchanged and the environment that produces the
# flake is the one that absorbs it.
#
# `--last-failed` re-runs only what failed, so the log names exactly
# what needed a second attempt, and the warning puts it in the run
# summary. A job that is green *because* of this step says so.
- name: tests (one retry of failures on a second attempt)
run: |
set -o pipefail
if python -m pytest tests/ -q; then exit 0; fi
echo "::warning title=Suite retried::The first attempt failed; re-running only the failed tests once. If this job is green, it needed two attempts — check the list below before trusting it."
python -m pytest tests/ -q --last-failed