[Coverage Report] Test Coverage Report — 2026-05-25 #3815
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-01T22:53:30.113Z.
|
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.
-
Overall Coverage
Test suite: 2183 tests across 98 suites (1 test failure — DNS pre-resolution IP address mismatch in environment, not a coverage gap)
🔴 Critical Gaps (< 50% statement coverage)
src/services/agent-environment.ts🟡 Low Coverage (50–79% statement coverage)
src/services/agent-volumes/hosts-file.ts🛡️ Security-Critical Path Status
src/host-iptables.tssrc/squid-config.tssrc/docker-manager.tssrc/domain-patterns.tssrc/cli.tssrc/host-iptables-rules.tssrc/squid/domain-acl.tssrc/squid/access-rules.ts📋 Coverage Summary by Category
🟢 100% coverage (fully tested): 47 files including all squid subsystem modules, all iptables modules, docker-manager, domain-utils, redact-secrets, schema-validator, all parsers, and all agent-environment sub-modules.
🟢 80–99% coverage (well tested): 20 files including cli.ts (85.7%), cli-workflow.ts (88.9%), config-writer.ts (89.3%), log-parser.ts (87.1%), and audit-enricher.ts (83.6%).
🟡 Low coverage (50–79%): 1 file —
hosts-file.ts(69%)🔴 0% coverage: 1 file —
agent-environment.ts(barrel re-export, not a real gap)🔍 Notable Findings
1.
src/services/agent-volumes/hosts-file.ts— Branch coverage at 61.9%The
generateHostsFileMount()function has three main uncovered paths:config.localhostDetectedbranch (inside theenableHostAccessblock) that rewrites127.0.0.1 localhostto the Docker bridge gateway IP — a security-relevant behavior.execa.sync('docker', ...)failure path when Docker bridge inspection fails.ipv4Regex.test(hostGatewayIp)returns false (malformed gateway IP).These are error-handling and security branches — the localhost rewrite especially matters since it changes how the agent resolves
localhostinside the chroot.2.
src/cli.ts— Branch coverage at 50%The CLI entry point has only 50% branch coverage despite 85.7% statement coverage. Uncovered branches likely include error-path handling and conditional flag combinations not exercised in unit tests (integration paths).
3.
src/commands/validators/network-options.ts— Branch coverage at 50%Network option validators are security-relevant (they validate domain allowlists, DNS servers, and proxy settings). Half the decision branches lack test coverage.
4. No gaps in core security paths
All four highest-priority security modules (
host-iptables.ts,squid-config.ts,docker-manager.ts,domain-patterns.ts) are at ≥97% coverage. This is the most important finding.📈 Recommendations
High — Add tests for
hosts-file.tsenableHostAccess+localhostDetectedbranch: This is a security-relevant path that rewrites howlocalhostresolves inside the sandbox. Mockexeca.sync('docker', ...)to return a valid gateway IP, then assert the localhost rewrite behavior. Also cover the failure path (bad IP format, docker command throws).Medium — Improve branch coverage in
src/cli.ts: Add tests for the remaining 50% of branches. Focus on error-handling paths: what happens when container startup fails, when signal handlers fire during different phases, and when--keep-containersis combined with failure modes.Medium — Cover
src/commands/validators/network-options.tsbranches: Network validation logic is security-sensitive. Add tests for edge cases: empty domain list, invalid DNS server IPs, conflicting proxy settings.Low — Suppress or exclude
agent-environment.tsbarrel file from coverage: The 0% coverage on this barrel re-export creates noise. Add it to Jest'scoveragePathIgnorePatternsor exclude pure re-export files to keep the report signal-to-noise ratio high.Generated by test-coverage-reporter workflow · Trigger:
push· Commit:a445bd9Beta Was this translation helpful? Give feedback.
All reactions