[Coverage Report] Test Coverage Report — 2026-06-21 #5363
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-28T18:01:54.781Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Overall health is strong. Branch coverage (93.58%) is the main gap area to watch.
Security-Critical File Coverage
host-iptables-rules.tshost-iptables-shared.tshost-iptables-cleanup.tshost-iptables-network.tssquid-config.tsdomain-patterns.tsdomain-matchers.tsdomain-validation.tscli.tsCoverage Gaps (Branch Coverage < 80%)
services/agent-volumes/etc-mounts.ts/etcfiles bind-mount into agentservices/api-proxy-service.tscli.tsservices/agent-volumes/system-mounts.tsservices/doh-proxy-service.tsAlso notable:
squid-log-reader.tsat 82.22% statement coverage — the only file with statements below 85%.Notable Findings
Security-critical enforcement paths are well-tested. The host iptables rules (
host-iptables-rules.ts, 96% branch), Squid config generation, and all domain validation/matching modules are at or above 95% across all metrics — the network isolation and ACL filtering logic is thoroughly exercised by the test suite.etc-mounts.tsbranch gap is the highest-risk gap. At 67.85% branch coverage, this file controls which/etcfiles are bind-mounted into the agent container (including SSL certs,passwd,group, andnsswitch.conf). Untested branches here could allow unintended file exposure or miss failure-mode handling that prevents sandbox escapes.API proxy credential injection has untested branches.
api-proxy-service.tssits at 50% branch coverage — only 1 of 2 branches is covered. The API proxy is the path through which real API keys are injected; any missed error or fallback branch here could leak credentials or silently fail credential substitution.cli.tsentry-point branches are largely untested (50%). While the file is small (7 statements), the uncovered branch likely covers error paths or environment guards. As the top-level orchestrator, any uncaught failure at this layer silently bypasses all downstream security controls.Recommendations
🔴 High —
etc-mounts.ts: Cover missing/etcmount branchesFile:
src/services/agent-volumes/etc-mounts.ts(67.85% branch coverage)Add unit tests for the mount-selection logic covering edge cases: missing source files, DinD path-prefix translation on
/etcentries, and thereadOnlyflag enforcement for each explicitly whitelisted/etcfile. These branches directly determine what host filesystem state the agent can read — missed branches represent untested access-control decisions.🔴 High —
api-proxy-service.ts: Cover credential-injection failure pathFile:
src/services/api-proxy-service.ts(50% branch coverage)The uncovered branch is likely the case where
api-proxyis disabled or the sidecar health check fails. Add a test for the disabled/skipped path and any error handling in credential injection to ensure credentials cannot leak silently. This is a high-value target: credential-handling code with untested branches is a common source of security regressions.🟡 Medium —
cli.ts+squid-log-reader.ts: Entry-point and log-reader resilienceFiles:
src/cli.ts(50% branches),src/squid-log-reader.ts(82.22% statements / 80% branches)For
cli.ts, add a test that simulates the uncovered branch (likelyrequire.main !== moduleguard or an unhandled rejection path). Forsquid-log-reader.ts, focus on malformed log line inputs and truncated reads — these paths are exercised in production when Squid restarts mid-run and could silently drop audit data if not handled correctly.🟢 Low — Sustain 99.5% function coverage
The suite covers 609 of 612 functions. Identify the 3 uncovered functions (likely in
config-file.ts,container-cleanup.ts, or edge utilities) and add minimal smoke tests to push function coverage to 100%. This prevents future silent dead-code accumulation.Beta Was this translation helpful? Give feedback.
All reactions