Skip to content

test: CI host-boot smoke gate (S6-002)#99

Merged
lwalden merged 2 commits into
mainfrom
test/s6-002-ci-host-boot-smoke
Jun 11, 2026
Merged

test: CI host-boot smoke gate (S6-002)#99
lwalden merged 2 commits into
mainfrom
test/s6-002-ci-host-boot-smoke

Conversation

@lwalden

@lwalden lwalden commented Jun 11, 2026

Copy link
Copy Markdown
Owner

What

Adds a CI host-boot smoke gate so a Functions worker that cannot boot can never merge behind green unit tests:

  • tools/ci/host-boot-smoke.sh — boots Azurite + func start for src/TradingSystem.Functions, polls /admin/functions until all 4 timer functions (DailyOrchestrator_PreMarket, DailyOrchestrator_EndOfDay, IncomeSleeve_MonthlyReinvest, IncomeSleeve_QuarterlyAudit) register, then scans the captured host log for TypeLoadException, language-worker start failure, and worker-restart loops. scan-log subcommand exercises the scanner in isolation. Always kills the func process tree on exit. Exit codes: 0 = pass, 1 = any failure (stderr is the diagnostic).
  • .github/workflows/ci.yml — new host-boot-smoke job (ubuntu-latest, pinned azurite@3.35.0 + azure-functions-core-tools@4.8.0); backend paths-filter extended with tools/ci/** and the workflow file itself; all-checks gate includes the new job.

Why

The 590-test xUnit suite never boots the Functions host — S5-004r shipped an AI 3.0/Worker-AI 2.50 TypeLoadException and a missing DI registration invisibly behind green tests. This automates the paper-validation runbook preflight steps 4-5 (worker boots, all 4 timers register) as a standing merge gate for src-touching PRs.

Review fix-now items applied (b7170f3)

  • ci.yml: npm global download cache keyed on the pinned versions string; job timeout 10 → 15 min; log artifact uploads on failure() || cancelled() with retention-days: 7; guard comment that only UseDevelopmentStorage is permitted in this job (the log would capture a real connection string).
  • Script (comments/echo only — gate logic unchanged): EXPECTED_FUNCTIONS source-of-truth comment (the four [Function] methods in DailyOrchestrator.cs / IncomeSleeveFunction.cs; the unexpected-extras WARN is the drift detector); Azurite-unreachable message gives local-context guidance; every failure path prints the captured log path; header honesty on undifferentiated 0/1 exit codes; jq listed as optional precondition.

Test plan

  • bash -n tools/ci/host-boot-smoke.sh — syntax clean; file is LF-only (.gitattributes pin)
  • ci.yml parses (PyYAML); host-boot-smoke job fields verified: timeout 15, cache key, failure() || cancelled(), retention-days 7, all-checks needs
  • Local GREEN (executor + re-verified after fix-now edits): PORT=7188 + throwaway Azurite on 10210-10212 — host booted, all 4 functions registered, no failure signatures, exit 0; live host (7071) and live Azurite (10000) untouched
  • Local RED (executor): scan-log subcommand against a log seeded with TypeLoadException / worker-restart lines — exit 1 with named signatures
  • dotnet build Release — 0 warnings, 0 errors
  • dotnet test — 590/590 passed
  • This PR itself triggers the new host-boot-smoke job (ci.yml is in the backend filter) — must pass on the ubuntu runner

🤖 Generated with Claude Code

lwalden and others added 2 commits June 10, 2026 18:41
…(S6-002)

Why: the 590-test xUnit suite never boots the Functions host, so a dead
host shipped invisibly behind green tests (S5-004r: TypeLoadException +
bare-type DI registration). This turns the runbook section 2 steps 4-5
preflight into a standing CI merge gate for every src-touching PR.

- tools/ci/host-boot-smoke.sh: starts func start against Azurite, polls
  /admin/functions (curl --max-time 5, 180s deadline) for the 4 expected
  timer names (extras warn, never fail silently), scans the captured log
  for TypeLoadException / language-worker failures / restart loops
  (scan-log subcommand for isolated testing), kills the process tree on
  exit. Env-only config, zero secrets, nothing echoed.
- ci.yml: host-boot-smoke job (ubuntu, timeout-minutes: 10, Core Tools
  4.8.0 + Azurite 3.35.0 pinned per spec D9), gated by the backend
  filter (extended with tools/ci/** and the workflow itself), wired into
  all-checks so it gates merges; host log uploaded on failure.

Verified locally: bogus expected name → exit 1 with clear message;
fixture logs (TypeLoadException, worker-fail, 3x restart) → exit 1;
clean real boot on PORT=7188 + throwaway Azurite → exit 0 in 13s.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review fix-now items from the S6-002 judge pass:
- ci.yml: cache ~/.npm keyed on the pinned tool versions; raise job
  timeout to 15 min; upload host log on failure OR cancellation
  (timeout-minutes kill) with 7-day retention; guard comment that only
  UseDevelopmentStorage is permitted (log may capture the connection
  string otherwise).
- host-boot-smoke.sh (comments/echo only, gate logic unchanged):
  EXPECTED_FUNCTIONS source-of-truth comment; Azurite-unreachable
  message gains local-context guidance; all failure paths print the
  captured log path; header states exit codes are 0/1 undifferentiated
  and lists jq as optional.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lwalden lwalden merged commit c596e83 into main Jun 11, 2026
5 checks passed
@lwalden lwalden deleted the test/s6-002-ci-host-boot-smoke branch June 11, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant