chore(ci): expand Rust test coverage and add audit/coverage jobs#105
Merged
Conversation
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 reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI previously ran only
cargo test --lib -p bubbaloop, silently skipping the 47-test MCP integration suite (gated ontest-harness), thebubbaloop-nodeSDK tests, allbubbaloop-schemastests, and every doc test. This PR splits the workflow into focused jobs that run them all, addscargo-auditfor RUSTSEC advisories,cargo-llvm-covfor coverage reporting, and the no-daemon phases ofvalidate.shfor template + schema-contract checks.CI before → after
cargo test --lib -p bubbaloop(~840)--workspace --lib(844, includes node SDK + schemas)--features test-harness(47 tests)--workspace --doccargo-audit(rustsec/audit-check@v2)cargo-llvm-cov, LCOV uploaded as artifact (no threshold gate yet — baseline 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 (geminiifGEMINI_API_KEYis set, elseclaude). Rewrote to mirror the actual cascade.integration_mcp::node_stream_info— encoding flippedprotobuf→cbor.integration_mcp::get_node_logs_existing—GetLogsgained alinesfield, visible via Debug formatting.validate.shrefreshThe Rust template moved from
node.rs.templatetomain.rs.templateand into the SDKNodetrait (queryables now come from the SDK, not the template). The JSON API moved fromzenoh_api.rstogateway.rs. Updated check targets accordingly and added--cimode 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, borrowedEnvelopeRefproduces identical wire bytes to ownedEnvelope,now_nssanity.bubbaloop-node/error.rs(5 tests): Display preserves topic/path,From<serde_json::Error>,Resultalias.bubbaloop/mcp/daemon_platform.rs(4 tests):build_node_commandfield coverage, request_id uniqueness, command-type round-trip.Test plan
cargo test --workspace --lib— 844 passcargo test -p bubbaloop --features test-harness --test integration_mcp— 47 passcargo test --workspace --doc— 1 passpixi run clippy(--all-targets --all-features) — cleancargo fmt --all -- --check— cleanscripts/validate.sh --ci— 32 / 32 checks passcargo-auditjob surfaces the 20 dependency vulnerabilities GitHub already flagged; triage in a follow-up🤖 Generated with Claude Code