Skip to content

Compute coverage on a single CI leg instead of every leg (part of #2702) #2708

Description

@acoliver

Compute coverage on a single CI leg instead of every leg

Summary

Coverage instrumentation is enabled unconditionally in every package's Vitest config, so it is computed on all four matrix legs while only one set of coverage artifacts is consumed.

Evidence

coverage: { enabled: true } appears in 11 package configs:

agents, auth, cli, core, ide-integration, mcp,
providers, settings, storage, telemetry, tools

The CI test job uploads a coverage artifact per matrix leg:

coverage-reports-24.x-ubuntu-latest-keyring
coverage-reports-24.x-ubuntu-latest-fallback
coverage-reports-24.x-macos-latest-keyring
coverage-reports-24.x-macos-latest-fallback

post_coverage_comment consumes coverage from a single leg.

Measured instrumentation cost on packages/cli:

baseline (coverage on)   138s
coverage off             119s

Approximately 19s for one package on one leg, repeated across packages and legs.

Proposed work

  1. Make coverage instrumentation conditional, enabled on one designated CI leg and disabled elsewhere.
  2. Keep coverage on by default for local runs, or provide an obvious opt-in, so developers do not lose the signal.
  3. Remove the now-redundant per-leg coverage artifact uploads.

Constraint

Coverage gates and the coverage comment must keep working. This issue reduces redundant computation; it must not reduce coverage visibility or drop an enforced threshold.

Acceptance criteria

  • Coverage is computed on exactly one CI leg.
  • The coverage comment and any coverage gate continue to function.
  • Redundant coverage artifacts are no longer uploaded.
  • Before/after timings recorded for at least the largest package.

Note

The matrix-leg count is itself being reduced by the sibling issue that removes the dead secure-store-mode dimension. These compose: fewer legs and coverage on one leg.

Implementation plan

Files to edit

13 coverage.enabled: true sites across 11 packages:

packages/agents/vitest.config.ts:270
packages/auth/vitest.config.ts:53
packages/cli/vitest.config.ts:347
packages/core/vitest.config.ts:224, 231
packages/ide-integration/vitest.config.ts:48
packages/mcp/vitest.config.ts:111, 124
packages/providers/vitest.config.ts:230
packages/settings/vitest.config.ts:113
packages/storage/vitest.config.ts:48
packages/telemetry/vitest.config.ts:113
packages/tools/vitest.config.ts:113, 120

Plus .github/workflows/ci.yml lines 845-849 (artifact upload) and 876 (consumer).

Note core, mcp, and tools each have two enabled: true sites — the second is inside the typecheck block. Check both.

Steps

  1. Introduce one shared switch, e.g. enabled: process.env.LLXPRT_COVERAGE !== 'false', defaulting to on so local runs are unaffected. Prefer a single shared helper over 13 independent copies — a divergent 14th will otherwise appear.
  2. Set the disabling env var on all but one designated CI leg.
  3. Remove the redundant per-leg coverage artifact uploads (849), keeping the designated leg's.
  4. Confirm post_coverage_comment (876) still finds its artifact.

Verification

cd packages/cli && npx vitest run --coverage.enabled=false --reporter=dot
# confirm test count unchanged, duration reduced

On the PR: confirm the coverage comment still posts and any coverage gate still evaluates.

Constraint

Do not drop an enforced coverage threshold. This removes redundant computation, not coverage visibility.

Sequencing

Compose with the dead-matrix removal: fewer legs first, then coverage on one of the survivors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci/cdIssues with github and the workflow scripts and CI CD environment.

    Type

    Projects

    Status
    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions