Repository navigation
Description
scripts/tests/test_bootstrap.py defines its checks as module-level test_* functions with its own check() collector and main() runner, and no unittest.TestCase. The only invocation in CI is validate-task.yml:117:
uvx coverage@latest run --source=scripts,spec,host-setup -m unittest discover -s scripts/tests
unittest discover loads TestCase subclasses from each module it imports. A module-level function named test_something is not one, so the file is imported (an import-time error would still surface) and none of its ten checks run. Nothing else invokes it either: the file is named in prose by host-setup/README.md, scripts/host_gate.py:220, and spec/host-tools.json's own note, and by no workflow, script, or runbook.
OPERATIONS.md "Run the gates the way CI runs them" lists the unittest discover line and no separate python3 scripts/tests/test_bootstrap.py, so a local verification run reproduces the gap rather than catching it.
What is not running
Confirmed by running the file directly, which passes:
$ python3 scripts/tests/test_bootstrap.py
[ OK ] bootstrap loader invariant and spec coverage
$ python3 -m unittest discover -s scripts/tests -v 2>&1 | grep -c bootstrap
1
That one line is a docstring from test_skills_install.py, not a collected bootstrap test.
The two properties the file's own docstring names as failing silently if nobody checks them are the ones nobody is checking:
- The loader invariant, that
bootstrap.shandbootstrap.ps1each read exactly one path into the fetched tree and no payload directory. The file states this is asserted rather than promised in prose precisely because it is a property of each file. - Spec-to-installer coverage, that every tool
spec/host-tools.jsonrequires is one the platform installers can provide, plus the totality of the remedy mapping.spec/host-tools.json'snotenames this file as what keeps that mapping total, andscripts/host_gate.py:220names it as what holds the fleet-wide remedy contract thathost_gate.pydeliberately does not hold itself.
So a tool could be declared required with nothing here able to install it, or a remedy could name a tool an installer does not manage, and the pull request that did it would pass.
Shapes that would close it
Not a recommendation, just what seems available:
- Wrap the existing checks in a
TestCasesounittest discovercollects them, keepingmain()for the direct-run path. Smallest change, and the two idioms then coexist in one file. - Convert the file to
unittestthe way the other six files underscripts/tests/are written, and drop thecheck()/failurescollector forsubTestor plain assertions. Consistent with its siblings, larger diff. - Invoke it as its own CI step, beside the
spec/audit.py --selftestandhost-setup/agent-safety/test_install.pylines that already run outsideunittest discover, and add it toOPERATIONS.md's list. Leaves the file's idiom alone.
Found while fixing #750 and #751, looking for a live home for a new test.
Activity
Convert test_bootstrap.py to unittest so discover collects it (#755)