Skip to content

Raise line coverage above the documented 80 percent threshold #52

@nficano

Description

@nficano

swift test --enable-code-coverage passed 112 tests, but the generated SwiftPM coverage report measured Sources/ARCP at only 74.58% line coverage, with 3,477 covered lines out of 4,662. Several public or critical files are untested or substantially under-tested, including Sources/ARCP/Auth/JWTAuth.swift at 0%, Sources/ARCP/Transport/WebSocketTransport.swift at 0%, Sources/ARCP/Trace/TraceContext.swift at 0%, Sources/ARCP/Runtime/JobContext.swift at 0%, Sources/ARCP/Runtime/StreamManager.swift at 12.12%, Sources/ARCP/Auth/AuthScheme.swift at 14.81%, Sources/ARCP/Runtime/LeaseManager.swift at 32.77%, and Sources/ARCP/Runtime/SubscriptionManager.swift at 35.51%. The generated report did not include coverage for the arcp-cli executable target, so CLI parsing and command behavior are also effectively unmeasured by this run.

Fix prompt: Add focused unit and integration tests until measured library coverage exceeds 80% and the CLI has explicit command tests. Prioritize JWT validation success and failure cases, WebSocket transport delivery and close behavior, trace propagation, stream manager open and close paths, permission lease grant, refresh, expiry, and denial paths, subscription backfill and empty-filter behavior, and CLI send, tail, and replay command paths. Add SwiftCheck property-based tests for boundary-heavy invariants such as ModelUse glob matching, CostBudget subset checks, typed id decoding, ULID ordering, and envelope encode/decode round trips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    severity:mediumMedium severity issuetestingTest coverage and test infrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions