[Coverage Report] Test Coverage Report — 2026-06-23 #5458
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-06-30T22:53:01.112Z.
|
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.
Coverage Summary
Overall line and function coverage is excellent. Branch coverage at 93.77 % is the only dimension below 98 % and is the focus of this report.
Security-Critical File Breakdown
src/host-iptables.ts(facade)src/host-iptables-rules.tssrc/host-iptables-chain.tssrc/host-iptables-shared.tssrc/host-iptables-validation.tssrc/squid-config.ts(facade)src/squid/access-rules.tssrc/squid/acl-generator.tssrc/squid/config-sections.tssrc/squid/domain-acl.tssrc/squid/validation.tssrc/docker-manager.ts(facade)src/domain-patterns.tssrc/cli.tsTop Coverage Gaps (Branch Coverage)
Files sorted by branch coverage, excluding test-utility files:
src/services/agent-volumes/etc-mounts.tssrc/cli.tssrc/services/api-proxy-service.tssrc/workdir-setup.tssrc/host-iptables-chain.tssrc/pid-tracker.tssrc/config-writer.tssrc/squid/config-sections.tssrc/ssl-bump.tsNotable Findings
src/services/agent-volumes/etc-mounts.tshas the most critical branch gap (67.85 %) — this module decides which/etcfiles are bind-mounted into the agent container, intentionally excluding sensitive paths like/etc/shadow. Nine of 28 decision branches are untested, meaning edge cases in the exclusion logic (e.g. missing optional files, DinD path-prefix translation) may silently fail, potentially exposing sensitive host files.src/cli.tsbranch coverage is 50 % — the main CLI entry point has a single untested branch. Although the file is tiny (7 lines, 2 branches), the uncovered path is in the top-level initialization/error flow. If that path triggers unexpectedly in production, it is entirely untested.Squid configuration has 5 uncovered branches in
src/squid/config-sections.ts— this module assembles the Squid proxy config that enforces domain ACL filtering. The 17.25 % uncovered branches likely correspond to optional configuration sections (e.g. upstream proxy passthrough, SSL-bump toggles). A misconfigured or bypassed section could weaken HTTP/HTTPS egress control.Overall quality is high — 98.09 % line coverage across 5,087 lines and 99.52 % function coverage indicate a mature test suite. All iptables-rule generation modules (
host-iptables-rules.ts,host-iptables-shared.ts), domain ACL modules (squid/access-rules.ts,squid/acl-generator.ts,squid/domain-acl.ts), and the domain validation stack are at 100 %.Recommendations
🔴 High — Harden
etc-mounts.tsbranch coverage (67.85 % → ≥ 90 %)src/services/agent-volumes/etc-mounts.tscontrols which host/etcfiles are exposed to the agent. Add unit tests covering:/etc/alternatives,/etc/ld.so.cache)--docker-host-path-prefixis set (DinD path translation throughnormalizeDockerHostPathPrefix)/etc/shadowand other sensitive filesThis is the most security-sensitive untested path in the codebase because a logic error could silently mount credentials into the agent environment.
🟡 Medium — Cover
cli.tsandhost-iptables-chain.tserror branchessrc/cli.ts(50 % branches): The untested branch is in the top-level entry-point boot flow. Add a test that exercises the failure/short-circuit path (e.g. invalid command, missing config) to ensure errors surface cleanly rather than silently succeeding.src/host-iptables-chain.ts(80 % branches): Two of ten decision branches in the iptables-chain setup module are uncovered. These likely guard rollback or cleanup paths. Add tests that simulate iptables-chain creation failures to confirm the firewall doesn't enter a partially-configured state.🟢 Low — Improve branch coverage in Squid config assembly and workdir setup
src/squid/config-sections.ts(82.75 %): Five branches covering optional Squid config sections (upstream proxy, SSL-bump mode) are untested. Add targeted unit tests for configs with and without each optional feature enabled.src/workdir-setup.ts(79.62 %): Eleven branches are uncovered in the temporary work-directory setup. Test failure paths such asmkdirerrors, pre-existing directories, and cleanup on early exit to ensure the firewall doesn't leave stale state in/tmp.All reactions