Skip to content

ci: report coordinator e2e statement coverage and raise unit test coverage - #1274

Merged
Gajesh2007 merged 28 commits into
masterfrom
ci/e2e-binary-coverage
Oct 6, 2026
Merged

Gajesh2007 merged 28 commits into
masterfrom
ci/e2e-binary-coverage

Conversation

@davidtai

@davidtai davidtai commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Title: ci: report coordinator e2e statement coverage and raise unit test coverage

Summary

This PR is the one PR for CI coverage and test infrastructure. It absorbs #1284 ("test(coordinator): raise statement coverage in store, appattest, promptcontract, datadog, mdm and cmd"). Close #1284 when this PR merges.

The PR has three parts:

  1. E2E coverage in CI. The E2E Integration Tests job now reports how much coordinator code the e2e tests run. Each of the three go test ./e2e/ lanes runs with -coverpkg over the production coordinator/... packages and writes binary coverage data (-test.gocoverdir). A new step merges the lanes, writes one row to the job summary, and uploads the data as the coordinator-e2e-coverage artifact (14 days). The tests and their pass/fail rules do not change.
  2. Unit coverage tests. 34 new test files and one shared helper under coordinator/tests/ raise statement coverage in the store, App Attest, prompt contract, Datadog, MDM, config, app and command packages. Only test files change. No production code changes.
  3. Flaky test fix. The App Attest subtest cancelled before first challenge failed 12 of 400 runs. It now has one exact expected outcome for each point where the worker stops.

Linked issue

None.

What changed and why

1. E2E coverage scoping

  • No coordinator binary. The e2e testbed does not run a coordinator binary. e2e/testbed/suite.go (startCoordinator) calls api.NewServer in the test process. So the PR instruments the coordinator packages in the e2e test binary.
  • Production packages only. A new step, "Select e2e coverage packages", lists coordinator/... and removes the tests, testkit and testdb packages. The coordinator test runner uses the same scope. Go 1.26 counts every listed package that the binary links, so a test package in the list would change the denominator.
  • Binary coverage data. Each lane writes to its own directory. go tool covdata textfmt merges the three directories into one text profile. The merge is exact.
  • set mode. It is the cheapest mode, so the TestProfile latency checks see the least extra work. The e2e tests do not use -race.
  • Report step (if: !cancelled()). A lane that failed or was skipped is not counted, and the summary names it. A low number never fails the job. The step fails only when a lane passed but wrote no data, or when the merged data has no coordinator rows or no total.
  • One shared script. scripts/coordinator-statement-coverage.sh keeps only the coordinator rows of a profile and prints the statement total. The Coordinator Tests job (ci.yml) and the e2e report (integration.yml) both call it. It fails on an empty profile, on a profile with no coordinator rows, and when there is no statement total. The component router (scripts/ci-component-paths.py) routes the script to the coordinator, integration and benchmark jobs.
  • Separate row. The unit number comes from a Linux job in ci.yml, and the e2e number comes from a macOS job in integration.yml. The two workflows have no order. A merged number needs a workflow_run job, which runs only from the default branch and cannot be tested in a PR. So the e2e number is its own row.

2. Unit coverage tests (from #1284)

All tests are in the mirrored coordinator/tests/ tree, in external _test packages. They use the exported and internal/ entry points. No test-only accessor was added to production code.

  • store (tests/store/contracts, memory and Postgres through storeBackends): API key lifecycle, log reports, billing sessions, device auth, invite codes, referrals, usage totals, model price delete.
  • appattest/service: Start worker lifecycle with testing/synctest, maintenance metrics, the attest and assert challenge send path over a loopback WebSocket, reply and receipt verification, StartSession, ReleaseReady, and inventory reconcile storage failures.
  • promptcontract: request body lowering for chat, completions, messages and responses; sidecar metrics; preload controller lifecycle; read-only artifact trees; supervisor helpers.
  • datadog: log forwarding to a local intake, and trace IDs in slog records.
  • mdm: RequestDeviceAttestation against a local MicroMDM stand-in.
  • config, app, cmd/coordinator: ReadAppConfig, the APNs attestor configuration through app.Run, and the real coordinator Main startup and SIGTERM drain.
  • Shared helper: coordinator/tests/internal/testkit/listen_port.go (FreeListenPort). The coordinator exits the process on a bind error, so the helper picks a free port below the macOS and Linux ephemeral port ranges.

3. Flaky test fix

The old subtest called runAttempt with a context that was already cancelled. With zero onboarding jitter, the select at the top of runAttempt can take timer.C before ctx.Done(). The prepare send then fails, and the outcome is prepare:send_failed.

The test now cancels the context only after synctest.Wait(), when the worker is blocked. It reads the stop point from the events:

  • No prepare frame sent: the outcome must be prepare:disconnected.
  • Prepare frame sent (read and checked): the outcome must be ready:disconnected.
  • No attest, assert or supported-ready outcome can occur.

Production code does not change. With a cancelled context the writer refuses the frame, so no frame gets to the provider in either case.

Before and after

Colors: blue = test run (unchanged), green = new or changed, grey = unchanged, red = no coverage or flaky.

Behavior

flowchart LR
  subgraph Before["Before"]
    direction TB
    B1["Coordinator Tests (ci.yml)"]:::run --> B2["unit coverage row<br/>inline scoping"]:::same
    B3["E2E lanes: paged, exact-cache, smoke"]:::run --> B4["no e2e coverage number"]:::none
    B5["appattest subtest<br/>cancelled before first challenge"]:::run --> B6["12 of 400 runs fail"]:::none
    B2 --> B7["coordinator/... 84.0%"]:::same
  end
  subgraph After["After"]
    direction TB
    A1["Coordinator Tests (ci.yml)<br/>+ 34 new test files"]:::new --> A2["unit coverage row<br/>shared script"]:::new
    A3["E2E lanes: paged, exact-cache, smoke"]:::run -. "covdata" .-> A4["Report e2e coverage"]:::new
    A4 --> A5["summary row: Coordinator (Go), e2e"]:::new
    A4 --> A6["artifact: coordinator-e2e-coverage"]:::new
    A7["appattest subtest<br/>cancel after synctest.Wait"]:::new --> A8["0 of 800 runs fail"]:::new
    A2 --> A9["coordinator/... 85.8%"]:::new
  end
  classDef run fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  classDef new fill:#dcfce7,stroke:#15803d,color:#052e16
  classDef same fill:#f1f5f9,stroke:#64748b,color:#0f172a
  classDef none fill:#fee2e2,stroke:#b91c1c,color:#450a0a
Loading

Code

flowchart LR
  subgraph Before["Before"]
    direction TB
    C1["ci.yml: Report coverage<br/>inline grep + go tool cover"]:::same
    C2["integration.yml: go test ./e2e/ -run ..."]:::run --> C3["test binary, not instrumented"]:::same
    C4["coordinator/tests/...<br/>existing tests"]:::run --> C5["production packages<br/>uncovered: workers, send paths,<br/>lowering branches, main startup"]:::none
  end
  subgraph After["After"]
    direction TB
    D0["scripts/coordinator-statement-coverage.sh"]:::new
    D1["ci.yml: Report coverage"]:::new --> D0
    D2["integration.yml: Select e2e coverage packages"]:::new --> D3["go test ./e2e/ -cover -covermode=set<br/>-coverpkg=production coordinator/...<br/>-args -test.gocoverdir=lane dir"]:::new
    D3 --> D4["go tool covdata textfmt"]:::new --> D0
    D5["coordinator/tests/... existing tests<br/>+ new external _test files<br/>+ testkit.FreeListenPort"]:::new --> D6["same production packages<br/>through exported and internal/ entry points"]:::same
    D5 --> D7["local doubles: httptest, loopback WebSocket,<br/>synctest, memory store, generated keys"]:::new
  end
  classDef run fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  classDef new fill:#dcfce7,stroke:#15803d,color:#052e16
  classDef same fill:#f1f5f9,stroke:#64748b,color:#0f172a
  classDef none fill:#fee2e2,stroke:#b91c1c,color:#450a0a
Loading

Coverage against master

Statement coverage of coordinator/... rows only, from scripts/run-coordinator-tests.py --race --coverprofile over every package except the top-level e2e package, with Postgres 16 (DATABASE_URL), as CI runs it. Before: master dccc9ee0. After: this branch (tests at 2c3060e4; b64826f8 only removes one duplicate assertion). Both runs were local, on the same machine, one after the other.

Package Statements Before (master) After Change (+ = more covered)
coordinator/store/postgres 3,793 73.3% 77.8% +4.5
coordinator/store/memory 3,277 89.7% 92.0% +2.3
coordinator/store 306 92.5% 93.5% +1.0
coordinator/appattest/service 521 77.4% 87.3% +10.0
coordinator/internal/appattest/receipt 119 48.7% 84.9% +36.1
coordinator/internal/appattest/exchange 235 80.9% 87.7% +6.8
coordinator/internal/appattest/qualification 113 88.5% 96.5% +8.0
coordinator/internal/promptcontract/endpoint 461 80.7% 97.2% +16.5
coordinator/internal/promptcontract/preload 174 83.3% 98.9% +15.5
coordinator/internal/promptcontract/process 69 75.4% 94.2% +18.8
coordinator/internal/promptcontract/sidecar 245 73.5% 86.1% +12.7
coordinator/promptcontract 339 86.4% 87.3% +0.9
coordinator/datadog 180 68.9% 87.8% +18.9
coordinator/mdm 269 79.9% 81.0% +1.1
coordinator/config 13 61.5% 100.0% +38.5
coordinator/app 486 0.0% 65.6% +65.6
coordinator/internal/command/coordinator 29 17.2% 44.8% +27.6
coordinator/... total 57,915 84.0% 85.8% +1.8

Read: every package that the new tests drive goes up, and the total goes from 84.0% to 85.8% (target 80%, report-only).

Of 258 coordinator packages, 41 go up, 213 do not change, and 4 go down by 1 to 4 statements. The 4 decreases are in packages that this PR does not test. Each missed block is a race or select-order branch, or depends on random test input: attestation/attestation.go:426 (-1 statement), internal/inference/attempt/race_loop.go:152 (-2), internal/provider/challenge/challenge_verify.go:394 (-4), internal/registry/providerwrite/wait.go:71 (-2).

The e2e coverage row comes from the E2E Integration Tests job on this head. It needs a macOS runner and models, so it was not measured locally.

Validation

All on the final tree (b64826f8) unless stated.

  • go build ./... and go vet ./coordinator/...: pass.
  • golangci-lint run (v2.1.6): 0 issues.
  • gofmt -l coordinator/tests: no output.
  • Layout guard go test ./coordinator/tests/ -run TestCoordinatorTestsAreIsolated: pass.
  • python3 scripts/test-coordinator-tests.py, test-ci-component-paths.py, test-provider-ci-workflow.py and test-docs-impact-check.py: OK.
  • actionlint: 3 findings, all in codex.yml and release-swift.yml. Master dccc9ee0 has the same 3 findings. None is in a file this PR changes.
  • shellcheck scripts/coordinator-statement-coverage.sh: clean.
  • Dry run of the real workflow steps (taken from the YAML with yq), on GOCOVERDIR data from a small coordinator test binary:
    • "Select e2e coverage packages": 263 packages, 0 test-only packages. covdata pkglist: 250 packages, 0 test-only.
    • Report with two lanes with data and the exact-cache lane failed without data: exit 0, summary row written.
    • A lane that passed but wrote no data: ::error::, exit 1.
    • No lane ran: exit 0, nothing to report.
    • ci.yml "Report coverage" on a -coverprofile run: exit 0, summary row written.
    • Script guards: empty profile exit 1, no coordinator rows exit 1, wrong argument count exit 2.
  • go test -race -count=1 with Postgres on every package that the new tests are in (tests/app, tests/appattest/service, .../authorization, .../exchange, tests/cmd/coordinator, tests/config, tests/datadog, tests/mdm, tests/promptcontract, tests/store/contracts): pass.
  • Full coordinator suite with Postgres (run-coordinator-tests.py --race --coverprofile, as CI runs it): pass on this branch and on master dccc9ee0.
  • Flaky fix: go test -race -count=400 -run 'TestExchangeWorkerObservesDisconnectAndMissingReady/cancelled_before_first_challenge' twice: 800 runs, 0 failures.
  • The three Postgres refund tests that failed on the earlier master (TestPostgresAuditAndApprovedRefund, TestStripeSettlementRecoveryContract/postgres, TestPostgresRejectedRefundRollsBackWithFlagWrite) now pass. fix(store): refund rejected Stripe withdrawals when the coordinator clock is ahead #1352 fixed them.
  • make docs-impact-check BASE=dccc9ee0: 44 changed files, OK.
  • make docs-check: 1 problem in 337 files. It is local only. docs/reference/configuration.md cites libs/mlx-swift-lm/Libraries/MLXLLM/Models/MiMo/MiMoV26RowExactProjection.swift. The local submodule checkout is at an older commit. The file is present at master's gitlink e407e899. This PR does not change configuration.md or the gitlink.
  • E2E Integration Tests job on this head writes the summary row and uploads coordinator-e2e-coverage. CI only.

Refactor Pass

#1274 (earlier pass): a dedicated refactor subagent changed the word-split E2E_COVER_FLAGS string to a quoted E2E_COVER_PKG, which removed three SC2086 suppressions. The copied coordinator-row scoping in ci.yml and integration.yml became one script.

#1284 (earlier pass): a dedicated refactor subagent made one shared testkit.FreeListenPort, replaced a racy bool with atomics, reused master's fixtures, and gave the files names for the behavior they check. There are 86 test functions before and after, with one rename. Every assertion stays.

This consolidation: a dedicated refactor subagent read the two merges and the referral test change against AGENTS.md.

  • Merge of test(coordinator): raise statement coverage in store, appattest, promptcontract, datadog, mdm and cmd #1284: no change. Only test files and five lines of test.md change. FreeListenPort does not copy any master helper.
  • Merge of master: no change. The shared script keeps all three checks that master put inline in ci.yml. The test.md workflow map keeps master's provider coverage text and this PR's e2e coverage text. No text is stale.
  • Referral test: one change, b64826f8. It removes a self-referral assertion that the port added, because master's TestReferralAttributionAtomicAndImmutable already checks it.

Merge notes

Components touched

  • coordinator (Go) (tests only)
  • provider (Rust, legacy)
  • provider-swift (Swift CLI)
  • console-ui (Next.js)
  • enclave (Swift)
  • infra / CI / release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated: docs/developer/test.md ("E2E coverage in CI", the coverage command, the FreeListenPort note and the CI workflow map row). CHANGELOG.md has one line under "CI and contributor workflow". The coverage tests are not user-visible, so they have no CHANGELOG line.
  • No documentation needed — reason:

Notes for reviewers

  • No production Go code changes. The e2e -run, -skip, -timeout and -p flags do not change.
  • If an e2e lane times out, Go does not write its counters. The summary then shows that lane as "no coverage data (step outcome: failure)".
  • Each e2e lane prints "no packages being tested depend on" warnings for packages the binary does not link. Master's coordinator runner prints the same warnings. A list from go list -test -deps ./e2e/ would remove them.
  • Dead code, not changed here: in coordinator/appattest/service/credential_owner.go, the CanonicalMachineID lookup (lines 28 to 34) cannot run.
  • Not tested, because a test would need a test-only accessor: the verifier-busy branch, the anonymous key-owner case, the APNS_MODE and APNS_TOPIC defaults, the PreloadController defaults, and rejectSymlinks and makeTreeContentsReadOnly.

🤖 Generated with Claude Code

davidtai and others added 4 commits September 29, 2026 09:07
Each coverage step now writes a table with the columns Component,
Statements or Lines, Regions or Branches, Functions and Target (80%,
report-only), then states its denominator and what it excludes.

The Go number now counts coordinator packages only; the profile also
holds e2e/testbed and a frozen docs evidence package. The Rust step
reads lines, regions and functions by field name from the JSON report
and fails when one is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cargo-llvm-cov leaves out every tests.rs module under src/ (four
files, 825 lines), not only src/artifacts/tests.rs. The Go step now
says when the profile has no coordinator rows, and the Rust step keeps
two decimals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the docs/developer/test.md conflict between #1252 and master.
Keep master's date-only stamp and runner note, and #1252's coverage wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The e2e testbed runs the coordinator inside the go test process, so the
three e2e lanes now run with -coverpkg over coordinator/... and write
binary coverage data with -test.gocoverdir. A new report step merges the
lanes with go tool covdata, writes one job-summary row, and fails only when
a lane passed but wrote no data. The lane data is uploaded as the
coordinator-e2e-coverage artifact for 14 days.

The test commands, filters, timeouts and pass/fail rules do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

Deployment failed for project d-inference with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: d-inference.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

davidtai and others added 8 commits September 30, 2026 15:52
… referrals and usage totals on both backends

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eceipts and session start

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontroller and supervisor helpers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, config checks and startup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep master's date-only stamp and runner note in docs/developer/test.md, and
keep the coverage summary wording from this branch in the CI workflow map row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Write the coordinator rows into the scoped profile with the grep that checks
them, and drop the sidecar step's unused pipefail (it has no pipeline now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the word-split E2E_COVER_FLAGS string with E2E_COVER_PKG so the
three lanes need no shellcheck SC2086 suppression; argv is unchanged.
State every failure condition of the e2e coverage report step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

Deployment failed for project eigen-homepages-darkbloom with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: eigen-homepages-darkbloom.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

Deployment failed for project d-inference-console-ui-dev with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: d-inference-console-ui-dev.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

Deployment failed for project d-inference-landing with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: d-inference-landing.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

davidtai and others added 6 commits October 4, 2026 16:26
…fixtures

Split store and mdm tests by domain, rename test files after their owners,
and share the event log, logger and in-memory provider socket across the
App Attest service tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master #1324 moved every coordinator test under coordinator/tests/ and
deleted coordinator/appattest/service/fixtures_test.go. The merge takes
master's deletion; the next commit ports the added helpers and tests to
the external test packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve docs/developer/test.md: keep master's stamp and its new
registry snapshot-age paragraph, then the scoped coverage paragraph;
in the CI workflow map, keep master's ci.yml row and apply this
branch's coverage-table wording to the coordinator and sidecar jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the coordinator reorganization, no production package holds a
_test.go file, so every coordinator package is credited through the
runner's -coverpkg list. Say so in the job summary and in test.md:
the coordinator/tests packages and their helpers are not instrumented,
a production package that no test imports counts at 0%, and the
component router decides whether either coverage table appears.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the ported #1252 coverage scoping and master 5b7a675.

Conflicts:
- integration.yml: master made the exact-cache lane a blocking gate
  (no continue-on-error). Keep master's step and comments, and keep this
  PR's step id and per-lane coverage directory.
- CHANGELOG.md: keep both sides under the CI and contributor workflow
  heading.
- docs/developer/test.md: take master's new sections and workflow-map
  ci.yml row, and add this PR's coverage clause to the integration row.
  The e2e coverage text no longer calls the exact-cache lane expected red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the coordinator/tests layout move, -coverpkg over coordinator/...
also instruments the test-only packages that a binary links, such as
tests/internal/testdb. A "Select e2e coverage packages" step now drops
the tests, testkit and testdb path segments, as
scripts/run-coordinator-tests.py does, and exports E2E_COVER_PKG.

The coordinator-row scoping that ci.yml and integration.yml both copied
moves to scripts/coordinator-statement-coverage.sh. It keeps the guards
of both copies: no blocks, no coordinator rows, or no statement total
fails the step. The component router selects the coordinator, integration
and benchmark jobs when the script changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head f54659e44e99 against base 7a0d4c1ad865.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Ten-PR pilot complete; maintainer evaluation required

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Previous review (not confirmed resolved)

Threat model review — advisory

Reviewed head b64826f8a062 against base dccc9ee03333.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Ten-PR pilot complete; maintainer evaluation required

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

davidtai and others added 5 commits October 4, 2026 21:54
Master moved every coordinator test into the mirrored coordinator/tests
tree and moved much of the tested code into coordinator/internal. Port
this PR's in-package tests to external test packages that use the
exported and internal APIs of the new owners:

- store: tests/store/contracts, on both backends through storeBackends.
- config: new tests/config.
- appattest/service: tests/appattest/service and its exchange and
  authorization packages; the exchange tests run a worker that
  StartSession starts, and the moved code is tested through
  internal/appattest/{exchange,receipt}.
- promptcontract: tests/promptcontract, through
  internal/promptcontract/{artifacts,catalog,endpoint,preload,process,sidecar}.
- datadog and mdm: tests/datadog and tests/mdm.
- cmd/coordinator: the startup test runs internal/command/coordinator.Main;
  the APNs attestor tests run app.Run in tests/app.

Tests that master already covers are dropped: the old-protocol row of
TestStartSessionRefusesUnservableRegistrations, TestTrustStatusAndMetricHooksAreOptional,
"non string instructions", the generation-mismatch cases of the preload
matches test and the datadog httpMetrics check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… owners

- testkit.FreeListenPort replaces two copies in the startup and APNs tests.
- The exchange harness moves to exchange_fixture_test.go; session_start
  uses it too.
- Background worker callbacks count with atomics, which removes a racy
  bool.
- The exchange tests use shadowKeyID, the name the service tests use.
- The artifact tree test uses master's readOnlyTempRoot.
- TestCatalogBoundedStatusError moves to catalog_state_test.go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR's subtest called runAttempt with a context that was already
cancelled. With zero onboarding jitter the select at the top of
runAttempt can take timer.C before ctx.Done(); the prepare send then
fails on the cancelled context and the attempt ends as send_failed
(12 of 400 runs failed at 41e718c).

The test now cancels only after synctest.Wait, when the worker is
durably blocked, so the cancelled context never reaches that select.
The jitter still decides where the worker blocks, so the test reads it
from the events: with no prepare sent the outcome must be
prepare:disconnected; after a sent prepare (read and checked) it must
be ready:disconnected. No attest, assert or supported-ready outcome may
appear. Production code is unchanged: with a cancelled context the
writer rejects the frame, so nothing reaches the provider either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master covered this branch only by timing in an unrelated suite; the
ported worker tests did not, so the package would read one statement
lower under the full run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidtai and others added 4 commits October 6, 2026 08:14
Absorbs #1284 (coordinator statement-coverage tests and the
deterministic appattest cancelled-before-challenge fix) into #1274.
One PR now covers CI coverage and test infrastructure.

No conflicts. docs/developer/test.md merged cleanly with both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in master through #1328 (goose migrations, store in
store/postgres/), #1344, #1351, #1352 and others.

Conflicts:
- ci.yml (Report coverage): master inlined the empty-profile,
  coordinator-row and statement-format checks (#1252). This PR moved
  the same checks into scripts/coordinator-statement-coverage.sh,
  which ci.yml and integration.yml both call. Keep the script call.
- docs/developer/test.md (coverage command): keep the script call.
- docs/developer/test.md (CI workflow map): keep master's ci.yml row
  (adds the provider coverage table) and this PR's integration.yml row
  (adds the e2e coverage row and artifact).

The #1284 store contract tests and coverage tests build and vet
against master's store layout with no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master #859 made RecordReferral a no-op when an account is referred
again by the same code, and a conflict (ErrReferralConflict) when a
second referrer or the referrer itself is used. The #1284 contract
test expected an error for the same-code repeat, so it failed on both
backends after the master merge.

Keep the assertion that an account cannot be referred twice: the
repeat with the same code must succeed without a second count, and a
second referrer must return ErrReferralConflict. Also check that a
self-referral is a conflict. The stats assertion (2 referred) still
proves that the repeat did not count twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test

Refactor pass: 2c3060e added a self-referral assertion that #1284 did
not have. Master already checks it in
TestReferralAttributionAtomicAndImmutable
(tests/store/contracts/consumer_settlement_test.go). Remove the copy.
Every #1284 assertion stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidtai davidtai changed the title ci: report coordinator statement coverage from the e2e tests ci: report coordinator e2e statement coverage and raise unit test coverage Oct 6, 2026
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

Deployment failed for project darkbloom-status with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: darkbloom-status.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@blacksmith-sh

blacksmith-sh Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_all_integration_gates_and_flags_remain (main.IntegrationWorkflowTests.test_all
_integration_gates_and_flags_remain)/
test_all_integration_gates_and_flags_remain (main.IntegrationWorkflowTests.test_all
_integration_gates_and_flags_remain)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Resolve docs/developer/test.md: take master's ci.yml row (adds
`make sqlc-check`) and keep this branch's integration.yml row (e2e
statement coverage and the coordinator-e2e-coverage artifact).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gajesh2007
Gajesh2007 merged commit 35ab6fc into master Oct 6, 2026
24 of 31 checks passed
@Gajesh2007
Gajesh2007 deleted the ci/e2e-binary-coverage branch October 6, 2026 20:24

This branch was successfully deployed

No deployments
benchmarks — f54659e4 Deployed Oct 6, 2026 by davidtai via E2E Benchmarks #2334
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.

2 participants