Skip to content

ci(sovereign): cargo test --workspace --lib (PMAT-159)#29

Merged
noahgift merged 2 commits into
mainfrom
fix/nextest-workspace-lib-pmat-159
Apr 20, 2026
Merged

ci(sovereign): cargo test --workspace --lib (PMAT-159)#29
noahgift merged 2 commits into
mainfrom
fix/nextest-workspace-lib-pmat-159

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented Apr 20, 2026

Summary

PMAT-159: the reusable workflow ran cargo nextest run --lib (root package only). For workspace-oriented repos like aprender, the root lib.rs is a stub — ci/test executed 0 tests. F11 p95 wall-clock was measuring compile/cache-fetch, not nextest signal.

Revised design (2026-04-20 after canary failure): ship --workspace --lib behind an opt-in test_workspace: false input so the fleet default is unchanged. Callers that want workspace-wide coverage pair it with test_args exclusions for crates that don't build in the sovereign-ci container.

Why opt-in

The first draft force-switched every caller. That broke aprender#934 because --exclude requires --workspace, and broke aprender main because the container can't build aprender-gpu (cuBLAS), aprender-cuda-edge (CUDA), or aprender-compute (SIGSEGV at exit). Opt-in resolves the chicken-and-egg: repos declare workspace-readiness explicitly.

Caller pattern (aprender#934)

jobs:
  ci:
    uses: paiml/.github/.github/workflows/sovereign-ci.yml@main
    with:
      test_workspace: true
      test_args: "--exclude aprender-gpu --exclude aprender-cuda-edge --exclude aprender-compute"

Changes

  • New boolean input test_workspace (default false = current behavior)
  • Test job: uses $TEST_SCOPE env (--workspace --lib or --lib)
  • Coverage job: same gating
  • Fallback chain preserved (-p $REPO_NAME still tried on failure)

Test plan

  • paiml/.github repo CI green on this branch (hook fix in place for YAML-only repo)
  • After merge: aprender#934 updated to set test_workspace: true → CI green
  • No other repo breaks (default stays --lib, behavior unchanged)

Refs paiml/infra#33 (PMAT-155 Phase 2 nextest migration blindspot)

F11 falsifier blind-spot from PMAT-155 investigation (paiml/infra#70):
cargo nextest run --lib at repo root only tests the root package, leaving
workspace-member libs silent.

Per-pilot impact (pre-fix):
  copia    - 227 tests (valid, single-crate repo)
  bashrs   - 5 tests   (root only; specs/runtime/oracle/wasm silent)
  aprender - 0 tests   (root lib.rs is a stub; all 60 workspace crates silent)

Fix: primary invocation now cargo nextest run --workspace --lib TEST_ARGS.
Coverage updated to match. The -p REPO_NAME fallback is retained for harness
quirks. Callers that need to skip workspace members (e.g. aprender's GPU crates)
pass test_args: --exclude X --exclude Y.

Blast radius: every repo's ci / test and ci / coverage will start running
workspace-member lib tests that were previously silent. May surface real bugs.

Recommended canary: merge, watch copia (no workspace effect), bashrs (4 new
members surface), aprender (requires test_args exclusions first).

Refs paiml/infra#70, PMAT-155, PMAT-159.
noahgift added a commit to paiml/aprender that referenced this pull request Apr 20, 2026
PMAT-155 investigation (paiml/infra#70) found the sovereign-ci.yml reusable
workflow runs `cargo nextest run --lib` at the repo root, which only tests
the root package. For aprender, the root lib.rs is a stub (added in #19) so
ci/test runs 0 tests — all 60 workspace-crate libs are silent.

paiml/.github#29 switches the reusable workflow's primary invocation to
`cargo nextest run --workspace --lib $TEST_ARGS`. When that merges, aprender's
ci/test will try to compile workspace members that don't build in the
sovereign-ci container:

  - aprender-gpu (cuBLAS not present)
  - aprender-cuda-edge (CUDA toolchain not present)
  - aprender-compute (SIGSEGV at test-harness exit; workspace-test handles
    this crate specially with a grep-based pass check)

This commit pre-stages `test_args` on the sovereign-ci call so ci/test excludes
those three crates, matching the workspace-test job's current exclusions. Safe
to land BEFORE paiml/.github#29 — while the reusable workflow still uses --lib
(root only), the --exclude flags are no-ops on a 0-test run.

Refs PMAT-155, PMAT-159, paiml/.github#29, paiml/infra#70.
noahgift added a commit to paiml/aprender that referenced this pull request Apr 20, 2026
PMAT-155 investigation (paiml/infra#70) found the sovereign-ci.yml reusable
workflow runs `cargo nextest run --lib` at the repo root, which only tests
the root package. For aprender, the root lib.rs is a stub (added in #19) so
ci/test runs 0 tests — all 60 workspace-crate libs are silent.

paiml/.github#29 switches the reusable workflow's primary invocation to
`cargo nextest run --workspace --lib $TEST_ARGS`. When that merges, aprender's
ci/test will try to compile workspace members that don't build in the
sovereign-ci container:

  - aprender-gpu (cuBLAS not present)
  - aprender-cuda-edge (CUDA toolchain not present)
  - aprender-compute (SIGSEGV at test-harness exit; workspace-test handles
    this crate specially with a grep-based pass check)

This commit pre-stages `test_args` on the sovereign-ci call so ci/test excludes
those three crates, matching the workspace-test job's current exclusions. Safe
to land BEFORE paiml/.github#29 — while the reusable workflow still uses --lib
(root only), the --exclude flags are no-ops on a 0-test run.

Refs PMAT-155, PMAT-159, paiml/.github#29, paiml/infra#70.
The initial PMAT-159 change force-switched every caller to `--workspace --lib`.
That breaks any repo whose workspace members don't build in the sovereign-ci
container (e.g. aprender-gpu needs cuBLAS, aprender-cuda-edge needs CUDA).

Switch to an opt-in `test_workspace` input (default false → current behavior).
Callers that want workspace-wide coverage pair it with `test_args` exclusions:

    with:
      test_workspace: true
      test_args: "--exclude aprender-gpu --exclude aprender-cuda-edge"

Refs paiml/infra#33
@noahgift noahgift merged commit 1e45234 into main Apr 20, 2026
2 checks passed
@noahgift noahgift deleted the fix/nextest-workspace-lib-pmat-159 branch April 20, 2026 14:15
noahgift added a commit to paiml/aprender that referenced this pull request Apr 20, 2026
paiml/.github#29 merged an opt-in test_workspace input that switches the
reusable workflow's test invocation from `cargo nextest run --lib` (root
only) to `cargo nextest run --workspace --lib`. Without this, aprender's
workspace-member lib tests (the interesting suite) never run in ci/test.

Pair it with the existing exclusions so aprender-gpu/cuda-edge/compute
are skipped — they don't build in the sovereign-ci container (cuBLAS /
CUDA / SIGSEGV at exit). The workspace-test job below still covers them
on GPU-ready hosts.

Refs paiml/infra#33
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