test(core,tools,paperclip): add coverage reporting and expand test suite#53
Open
anhermon wants to merge 2 commits into
Open
test(core,tools,paperclip): add coverage reporting and expand test suite#53anhermon wants to merge 2 commits into
anhermon wants to merge 2 commits into
Conversation
- Add test modules for config.rs (8 tests: defaults, TOML round-trip, API key resolution with env-var fallback) - Add test module for message.rs (8 tests: constructors, text extraction from plain text and blocks, serialization round-trips, stop reasons) - Expand tools/registry.rs tests (5 new: input validation, overwrite behavior, schema listing, ToolOutput constructors) - Expand tools/schema.rs tests (5 new: JSON structure validation, to_def conversion, extra fields, empty required, error messages) - Add test module for paperclip/types.rs (10 tests: status/priority serde, Display impls, ordering, optional field defaults, camelCase serialization, checkout/update request shape) - Add cargo-tarpaulin coverage job to CI with XML+HTML report artifacts Closes ANGA-597 Co-Authored-By: Paperclip <noreply@paperclip.ing>
Owner
Author
Review: PR #53Recommendation: Approve. Well-structured, additive-only PR. Expands tests from ~43 to 135 across 5 modules. Test quality is good — focused assertions, ENV_LOCK guards, follows existing patterns. Strengths:
Minor notes (non-blocking):
LGTM — ship it. |
anhermon
commented
Apr 6, 2026
anhermon
left a comment
Owner
Author
There was a problem hiding this comment.
CTO Review — Approve
Strict superset of #52 — covers core, tools, and paperclip crates with 135 tests. CI job is cleaner (XML/HTML artifacts, no version pin).
Minor notes (non-blocking):
- Cross-module env-var race between
auth::testsandconfig::tests(separate mutexes) set_var/remove_vardeprecated in Rust 1.85+ — track for future migration
- Add 6 tests for AgentEvent: label(), summary() (short/long text, token counts), detail() JSON validity, timestamp(), all event variants - Add 5 tests for GatewayStatus Display impl: all status variants - Add 11 tests for App state management: new(), push_event() basic/cap/overflow, select_next/prev (basic, empty list, bounds), handle_key (quit, nav, home/end) Completes coverage for all crates >100 LOC (ANGA-597) Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.
Thinking Path
#[test]functions exist, but several crate modules have zero testscore/config.rs,core/message.rs, expanded stubs intools/registry.rs,tools/schema.rs, andpaperclip/types.rscargo-tarpaulinis the standard lightweight optionEchoProvideror pure-unit patterns per CONTRIBUTING.md — no real API callsWhat Changed
crates/core/src/config.rs— 8 new tests: default values, DB path structure, API key resolution (config vs env-var fallback for claude/openai/unknown backends), TOML round-trip serialization, graceful load when config file is missingcrates/core/src/message.rs— 8 new tests: role constructors, text extraction from plain text and structured blocks, ContentBlock round-trip, StopReason serialization, Usage defaultscrates/tools/src/registry.rs— 5 new tests: input validation before dispatch, handler overwrite behavior, schema listing,ToolOutput::ok/ToolOutput::errconstructorscrates/tools/src/schema.rs— 5 new tests: JSON structure validation forsimple(),to_def()conversion, extra fields pass validation, empty required list, error message contains field namecrates/paperclip/src/types.rs— 10 new tests:IssueStatus/IssuePriorityserde and Display impls, priority ordering,AgentIdentity/InboxItem/Commentdeserialization, optional field defaults,UpdateIssueRequestskip_serializing_if,CheckoutRequestcamelCase.github/workflows/ci.yml— newcoveragejob: installscargo-tarpaulin, runs workspace coverage, uploads XML+HTML report artifact (30-day retention)Verification
For CI coverage job: verify the
coveragejob appears in Actions after merge and produces an artifact.Risks
Low risk. All changes are additive (new test modules and CI job). No public API changes. No dependency additions —
cargo-tarpaulinis installed at CI runtime only.Pre-existing env-var race between
auth::testsandconfig::tests(both mutateHOME/ANTHROPIC_API_KEY) can cause flaky failures under parallel test execution. Both modules use per-moduleMutexguards, but cross-module guards are not possible in Rust's test harness. Mitigation: CI already runscargo testwithout--test-threadsrestriction, and the race is rare.Checklist
cargo testpasses locallycargo clippy -- -D warningsis cleancargo fmthas been runCloses ANGA-597