Skip to content

chore(ci): expand Rust test coverage and add audit/coverage jobs#105

Merged
edgarriba merged 3 commits into
mainfrom
chore/ci-qa-coverage
May 21, 2026
Merged

chore(ci): expand Rust test coverage and add audit/coverage jobs#105
edgarriba merged 3 commits into
mainfrom
chore/ci-qa-coverage

Conversation

@edgarriba

Copy link
Copy Markdown
Member

Summary

CI previously ran only cargo test --lib -p bubbaloop, silently skipping the 47-test MCP integration suite (gated on test-harness), the bubbaloop-node SDK tests, all bubbaloop-schemas tests, and every doc test. This PR splits the workflow into focused jobs that run them all, adds cargo-audit for RUSTSEC advisories, cargo-llvm-cov for coverage reporting, and the no-daemon phases of validate.sh for template + schema-contract checks.

CI before → after

Job Before After
Workspace tests cargo test --lib -p bubbaloop (~840) --workspace --lib (844, includes node SDK + schemas)
Integration tests not run --features test-harness (47 tests)
Doc tests not run --workspace --doc
Security audit none cargo-audit (rustsec/audit-check@v2)
Coverage none cargo-llvm-cov, LCOV uploaded as artifact (no threshold gate yet — baseline only)
Contract checks manual only scripts/validate.sh --ci (32 checks, no daemon required)

Stale assertions surfaced by the audit (fixed inline)

Running the previously-unrun tests exposed three assertions that no longer match current behavior:

  • agent::runtime::tests::agents_config_provider_defaults_to_claude — default provider became env-sensitive (gemini if GEMINI_API_KEY is set, else claude). Rewrote to mirror the actual cascade.
  • integration_mcp::node_stream_info — encoding flipped protobufcbor.
  • integration_mcp::get_node_logs_existingGetLogs gained a lines field, visible via Debug formatting.

validate.sh refresh

The Rust template moved from node.rs.template to main.rs.template and into the SDK Node trait (queryables now come from the SDK, not the template). The JSON API moved from zenoh_api.rs to gateway.rs. Updated check targets accordingly and added --ci mode that skips compile/test phases (CI runs those directly) plus the live-Zenoh orphan-topic lint.

New unit tests

Filled coverage gaps in three under-tested modules with focused tests:

  • bubbaloop-node/envelope.rs (5 tests): Header + Envelope CBOR round-trips, borrowed EnvelopeRef produces identical wire bytes to owned Envelope, now_ns sanity.
  • bubbaloop-node/error.rs (5 tests): Display preserves topic/path, From<serde_json::Error>, Result alias.
  • bubbaloop/mcp/daemon_platform.rs (4 tests): build_node_command field coverage, request_id uniqueness, command-type round-trip.

Test plan

  • cargo test --workspace --lib — 844 pass
  • cargo test -p bubbaloop --features test-harness --test integration_mcp — 47 pass
  • cargo test --workspace --doc — 1 pass
  • pixi run clippy (--all-targets --all-features) — clean
  • cargo fmt --all -- --check — clean
  • scripts/validate.sh --ci — 32 / 32 checks pass
  • PR CI itself stays green (one of the points of this PR is to exercise it)
  • cargo-audit job surfaces the 20 dependency vulnerabilities GitHub already flagged; triage in a follow-up

🤖 Generated with Claude Code

CI previously ran only `cargo test --lib -p bubbaloop`, silently skipping
the 47-test MCP integration suite (gated on `test-harness`), the
bubbaloop-node SDK tests, all bubbaloop-schemas tests, and every doc test.
Split the workflow into focused jobs that run them all, plus cargo-audit
for RUSTSEC advisories, cargo-llvm-cov for coverage reporting, and the
no-daemon phases of validate.sh for template + schema-contract checks.

Surfacing the previously-unrun tests exposed three stale assertions that
no longer match current behavior; fixed inline:

- agent::runtime: default provider became env-sensitive (gemini vs claude),
  rewrote test to mirror the actual cascade.
- integration_mcp::node_stream_info: encoding flipped protobuf -> cbor.
- integration_mcp::get_node_logs_existing: GetLogs gained a `lines` field
  visible in Debug formatting.

Also refreshed validate.sh after the rust template moved to the SDK Node
trait (node.rs.template -> main.rs.template) and the JSON API moved from
zenoh_api.rs to gateway.rs; added a --ci mode that skips compile/test
phases (CI runs those directly) and the live-Zenoh orphan-topic lint.

Filled coverage gaps in three under-tested modules with focused unit tests:

- bubbaloop-node/envelope.rs: header + Envelope CBOR round-trips, borrowed
  EnvelopeRef matches owned wire bytes, now_ns sanity.
- bubbaloop-node/error.rs: Display preserves topic/path, From<serde_json>,
  Result alias.
- bubbaloop/mcp/daemon_platform.rs: build_node_command field coverage,
  request_id uniqueness, command-type round-trip.

Verified locally: 844 workspace lib tests pass (was 840), 47 integration
tests pass (was 0 run), 1 doc test passes, clippy --all-features clean,
validate.sh --ci all 32 checks pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

edgarriba and others added 2 commits May 21, 2026 09:54
The Rust job's `pixi run clippy` runs with `--all-features`, which activates
the `dashboard` feature. That feature's `bubbaloop_dash` binary embeds
`dashboard/dist/` via `rust-embed` at compile time — when the dir is absent
the entire build fails. Splitting the dashboard build into its own job
broke this invariant. Build the dashboard inline in the rust job (mirrors
the original CI), keeping the dashboard job for tests only.

`cargo-audit` failed because GitHub already lists ~20 known advisories on
`main`. Gate it as `continue-on-error: true` so the job reports findings
without blocking PRs; flip to required after the team triages and either
upgrades or adds entries to `deny.toml`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Job-level `continue-on-error: true` keeps the workflow green but the
individual CheckRun still has `conclusion: FAILURE`, which surfaces as a
red check in `gh pr checks` and blocks `gh pr merge --auto`. Moving to
step level makes the action's failure get marked as success at the
check level too, while findings still annotate the job log.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@edgarriba edgarriba merged commit 0f57ac9 into main May 21, 2026
5 checks passed
@edgarriba edgarriba deleted the chore/ci-qa-coverage branch May 21, 2026 08:06
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