test: lint test code in CI, and run core's integration tests (#379) #398

Merged
sharang merged 1 commits from test/clippy-tests into main 2026-09-25 11:41:57 +00:00
Owner

Closes #379.

CI linted only non-test code, and compliance-core not at all: clippy -p compliance-agent doesn't lint its dependencies. Test code therefore collected lint errors unnoticed: 142 in the agent, 17 in core, 18 in control-map, and hundreds in the dashboard's test builds. compliance-core/tests/models.rs did not even compile. It still used TrackedRepository, a type that no longer exists, and CI never ran it.

Changes

  • clippy.toml: allow-unwrap-in-tests and allow-expect-in-tests. A panic is how a test fails. Production code keeps the workspace-wide deny on unwrap_used / expect_used.
  • Test crates (tests/*.rs, tests/common, tests/e2e.rs) get the file-level allow the other test files already have.
  • Remaining lint fixes:
    • explicit lifetimes elided in test helpers;
    • two test modules moved to the end of their files (scheduler.rs, models/scan.rs);
    • .err().expect() replaced by a let … else;
    • clippy --fix removed needless borrows in the e2e tests;
    • the embedding batch-size test is now a compile-time check next to the constant (const _: () = assert!(EMBED_BATCH_SIZE <= 25)).
  • compliance-core/tests/models.rs: the TrackedRepository test is removed (the type is gone). The other 42 tests run again.
  • CI (.gitea/workflows/ci.yml):
    • every clippy step uses --all-targets;
    • a new "Clippy (core)" step;
    • a new "Tests (core integration)" step, cargo test -p compliance-core --tests, which needs no services.

Checked

  • cargo clippy --all-targets -- -D warnings is clean for core, agent, mcp, werkbank-exec, control-map and the dashboard (server, web).
  • Tests: agent 447, core 99 + 42 integration, control-map 12, dashboard 52 / 36.
  • ci.yml parses.

Test code from PRs merged after this one is linted too, so a later rebase may surface a lint or two.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Closes #379. CI linted only non-test code, and `compliance-core` not at all: `clippy -p compliance-agent` doesn't lint its dependencies. Test code therefore collected lint errors unnoticed: 142 in the agent, 17 in core, 18 in control-map, and hundreds in the dashboard's test builds. `compliance-core/tests/models.rs` did not even compile. It still used `TrackedRepository`, a type that no longer exists, and CI never ran it. ## Changes - **`clippy.toml`:** `allow-unwrap-in-tests` and `allow-expect-in-tests`. A panic is how a test fails. Production code keeps the workspace-wide deny on `unwrap_used` / `expect_used`. - **Test crates** (`tests/*.rs`, `tests/common`, `tests/e2e.rs`) get the file-level allow the other test files already have. - **Remaining lint fixes:** - explicit lifetimes elided in test helpers; - two test modules moved to the end of their files (`scheduler.rs`, `models/scan.rs`); - `.err().expect()` replaced by a `let … else`; - `clippy --fix` removed needless borrows in the e2e tests; - the embedding batch-size test is now a compile-time check next to the constant (`const _: () = assert!(EMBED_BATCH_SIZE <= 25)`). - **`compliance-core/tests/models.rs`:** the `TrackedRepository` test is removed (the type is gone). The other 42 tests run again. - **CI (`.gitea/workflows/ci.yml`):** - every clippy step uses `--all-targets`; - a new "Clippy (core)" step; - a new "Tests (core integration)" step, `cargo test -p compliance-core --tests`, which needs no services. ## Checked - `cargo clippy --all-targets -- -D warnings` is clean for core, agent, mcp, werkbank-exec, control-map and the dashboard (`server`, `web`). - Tests: agent 447, core 99 + 42 integration, control-map 12, dashboard 52 / 36. - `ci.yml` parses. Test code from PRs merged after this one is linted too, so a later rebase may surface a lint or two. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-25 11:33:29 +00:00
test: lint test code in CI, and run core's integration tests (#379)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m54s
812ebe3c54
Test code was never linted and compliance-core not at all; its
integration tests did not compile (TrackedRepository no longer
exists). Tests may now unwrap (clippy.toml), the remaining lints are
fixed, CI runs clippy with --all-targets on every crate including
core, and core's integration tests run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang force-pushed test/clippy-tests from 314d319b99 to 812ebe3c54 2026-09-25 11:33:29 +00:00 Compare
sharang merged commit fdf22e99c0 into main 2026-09-25 11:41:57 +00:00
Sign in to join this conversation.