test: unify the test harness, discover suites, fix a real hermeticity leak #134
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
rootiest (Rootiest)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#134
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
tests/had three files in three idioms, hand-named inrun-tests.fish. Unified into onetests/lib.fishassertion core (check,section,report) and a driver that discoverstests/test-*.fishby glob instead of naming each suite. 332 pre-existing assertions preserved with identical per-phase counts (317 vault, now 15→17 session — the count was mis-attributed before, see below).The finding that mattered most
tests/test-agents-vault.fishwas documented as hermetic. Run directly, it wasn't: it loaded the live config and real universal variables (registry entry count measured at 65 with config loaded, 0 with--no-config). This job's whole task was writing guard tests that manipulate exactly those variables (set -e __fish_config_op_logging, etc.) — so without this fix, the tests written to prove the guard system safe would have been capable of erasing a real universal variable from the maintainer's running shell. Fixed first, before any guard test was written (dd672de).The obvious hardening —
env -i HOME=$sandbox— was rejected: it would have made the vault suite's two existing hermeticity assertions vacuous (both snapshots readabsentbefore and after, still green, asserting nothing).HOMEstays real; onlyXDG_*is sandboxed. That reasoning is a code comment at both call sites, not just in the design doc.Guard-system coverage
66 new cases covering
__fish_variable_check's four exit codes, the subcategory→category→master cascade, C5 opt-in (including that a truthy master switch cannot enable it — the specific regressionAGENTS.md§5 warns has recurred before), registry lookup, andalways/on/always/off/AND-across-tags via a synthetic registry (the production registry has 65 entries, every one single-tag, with noalways/*anywhere — those code paths are otherwise unreachable from real data).All 66 pass. No defects found in the guard system itself.
332 → 398 total assertions.
Also fixed, found in passing
The runner called bare
cp, which this config aliases tocp -i. On an existing destination with stdin at EOF it silently skips the copy and exits non-zero — but the runner never checked that status, so a partially-populated sandbox could report as a clean pass. Latent today only because the sandbox destination is always a freshmktemp -d. All runner utilities now go throughcommand.Corrections to two claims that didn't survive verification
rm -rfwas being intercepted by this config's trash wrapper; verified false — the wrapper bails tocommand rmfor any non-recursive flag, and-fis such a flag.exit $TESTS_FAILED. Fish clampsexit/returnto 255 rather than wrapping (fish -c 'exit 256'→ 255; POSIXshgives 0).report'stest $TESTS_FAILED -eq 0ending is kept as anAGENTS.md§5 style-conformance change, not a bug fix.Please merge before #refactor/config-settings-renderer
That PR's last commit hand-adds a phase to the old
run-tests.fish. If this PR lands first, that commit becomes droppable entirely — this driver's glob-based discovery picks uptests/config-settings-render.fishwith no changes needed.Testing
fish tests/run-tests.fish— 226/226 lint (unchanged), 398/398 total assertions, exit 0. Every commit gated green; a dedicated task proves the harness goes red on a broken assertion, a broken mode marker, and reports exit 1 correctly before landing any new coverage.