test(core): add coverage reporting and expand test suite#52
Conversation
Release: merge dev into main (26 commits)
The two auth::resolve() tests both mutate CLAUDE_CONFIG_DIR and ANTHROPIC_API_KEY env vars. When cargo runs them in parallel, one test can clear the vars while the other is still using them, causing a spurious "No Anthropic credentials found" failure. Add a static Mutex so the tests serialize their env-var access. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add cargo-tarpaulin coverage reporting to CI workflow with artifact upload and step summary. Expand core crate tests: config defaults, API key resolution, TOML roundtrip, message constructors, content extraction, and serde roundtrips. Closes ANGA-597 Co-Authored-By: Paperclip <noreply@paperclip.ing>
cargo-tarpaulin 0.35.2 pulls gimli 0.33.0 which requires rustc 1.88. Pin to ~0.31 series which compiles on the stable rustc 1.86 in CI. Co-Authored-By: Paperclip <noreply@paperclip.ing>
The parser was looking for top-level covered_lines/coverable_lines keys which don't exist in tarpaulin's JSON output. Parse the actual traces array from file entries instead. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Review: PR #52Recommendation: Close in favor of PR #53. PR #53 is a strict superset of this PR. It covers the same Issues in #52 not present in #53:
Action: Close this PR and proceed with #53. |
anhermon
left a comment
There was a problem hiding this comment.
CTO Review — Close in favor of #53
PR #52 is a subset of #53 (79 tests vs 135, 4 files vs 6). Has additional issues: fragile inline Python parser, tarpaulin version pin (~0.31 will break), missing ENV_LOCK guard on config test.
#53 is the strict superset. Recommend closing #52 and merging #53 instead.
Summary
cargo-tarpaulincoverage reporting to CI with artifact upload and GitHub step summaryharness-core: config defaults, API key resolution, TOML roundtrip, message constructors, content block extraction, serde roundtripsVerification
cargo test --workspace— all 79 tests passcargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleantarpaulin-report.jsonartifactBaseline Coverage
45.31% — 880/1942 lines covered (established from first tarpaulin CI run)
Closes ANGA-597
🤖 Generated with Claude Code