Repository navigation
Done
Labels
Description
Problem
On a fresh public clone, npm test fail-fast dies at src/campaigncontrol/__tests__/repository-budget-v2.integration.test.ts:
Error: Required Fleet test source is missing; run the CI source staging step
at requiredFleetTestRoot (src/campaigncontrol/__tests__/fleet-test-source.ts:7)
scripts/run-tests.mjs stops at the first failure, so none of the remaining ~325 test files run locally. The Fleet source is private and staged only in private CI (.github/workflows/ci.yml: scripts/stage-fleet-test-source.mjs + FLEET_SECURITY_WATCH_TEST_ROOT). A contributor cannot get a green local run.
Architecture (independent solution)
Do not make the private source public and do not delete the integration test. Make absence explicit and skippable at the test boundary:
- In
fleet-test-source.ts, replace the hard throw on missing env with a typedFleetTestSourceUnavailableresult /isFleetTestSourceAvailable()probe. Keep the second check (bridge file missing under a set root) as a hard error — that is a misconfiguration, not absence. - At the top of every Fleet-dependent integration entry point, if unavailable: print one line
skip: Fleet integration source not staged (set FLEET_SECURITY_WATCH_TEST_ROOT)and exit 0. Mirror the repo's existing skip idiom if one exists; do not invent a framework. scripts/run-tests.mjsneeds no change if the test file itself exits 0 on skip. Verify the runner counts it as passed and continues.- When the env var is set, behavior is byte-identical to today (private CI unchanged).
Scope / non-goals
- No change to
scripts/stage-fleet-test-source.mjs, CI, or any Fleet logic. - No stub/fake Fleet source committed to satisfy the test.
Acceptance
- Fresh clone without
FLEET_SECURITY_WATCH_TEST_ROOT:npm testruns past the Fleet integration file and reports the skip line once. - With the env var set to a bogus path: hard failure naming the missing bridge file.
- With a correctly staged source (CI): integration test still executes (not skipped).
Tests (happy / sad / bad)
- Happy: env unset → skip line, exit 0, runner continues to next file.
- Sad: env set, bridge missing → non-zero, message names expected path.
- Bad: env set to a file (not a dir) → non-zero, no stack-only crash.
Contributor notes
Small, self-contained, no private data needed. Start from src/campaigncontrol/__tests__/fleet-test-source.ts and its callers (grep -rn requiredFleetTestRoot src).
Activity
Let Fleet-dependent tests skip cleanly without the private test source (
Let Fleet-dependent tests skip cleanly without the private test source (
Let Fleet-dependent tests skip cleanly without the private test source (
Consolidate Fleet skip into one shared probe (#180 follow-up)
w4ffl35 commentedon Dec 5, 2026
Issue 180 — Closing Report
Files changed
.../operations/campaign_budget_bridge.py, not just the root)shouldSkipFleetTest/requiredFleetTestRoot; deletedisPrivateFleetSource, fixed an 81-char import)Baseline (before)
SKIP repository-budget-v2 integration: Fleet source not staged, exit 0 (already landed in f3a36ff/51354a6b).Required Fleet test bridge is unavailable at /tmp/hcl-bogus-fleet-xyz(named the root, not the bridge file).Baseline (after)
SKIP repository-budget-v2 integration: Fleet source not staged, exit 0; runner continues (run-tests: all 341 file(s) passed).Required Fleet test bridge is unavailable at /tmp/hcl-bogus-fleet-xyz/operations/campaign_budget_bridge.py, non-zero.All 4 fleet-test-source tests passed(happy/sad/bad covered).requiredFleetTestRoot()still returns the resolved root when the bridge exists (covered bystaged source never skipstest); private CI behavior byte-identical.Boot check
Full
npm test:run-tests: all 341 file(s) passed.npx tsc --noEmitclean. New test files add zero standards violations; remainingcheck-standards/check-architecturedeltas are pre-existing baseline lines untouched by this change.Residual risk / notes
src/rsi/__tests__/fleet-budget-integration.test.tspreviously searched../fleet-security-watchsibling checkouts and verified the git remote; it now uses only the stagedFLEET_SECURITY_WATCH_TEST_ROOT. If any private workflow relied on the sibling-checkout fallback instead of the staging step, that workflow must set the env var (CI already does viascripts/stage-fleet-test-source.mjs).PR: #204
Merge pull request #204 from Capsize-Games/issues/w12-2026-12-05