[Coverage Report] Test Coverage Report — 2026-05-08 #2718
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-05-15T04:12:27.078Z.
|
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
49 test files covering 56 source files.
🔴 Critical Gaps (< 50% statement coverage)
src/cli.tscli.tsis the main entry point and orchestration layer. It has 1,200+ lines with only ~5% branch coverage, meaning nearly all argument parsing, validation logic, and command dispatch paths are untested.🟡 Low Coverage (50–79% statement coverage)
None — all other files exceed 77%.
🛡️ Security-Critical Path Status
src/host-iptables.tssrc/squid-config.tssrc/docker-manager.tssrc/domain-patterns.tssrc/cli.tshost-iptables.tsbranch coverage at 74.1% — 18 branches total, ~5 uncovered. These likely include IPv6 path handling, error recovery inensureFirewallNetwork(), and edge cases incleanupHostIptables().📋 Full Coverage Table
src/cli.tssrc/container-cleanup.tssrc/logs/audit-enricher.tssrc/logs/log-parser.tssrc/host-iptables.tssrc/commands/logs-command-helpers.tssrc/container-lifecycle.tssrc/services/doh-proxy-service.tssrc/cli-workflow.tssrc/services/agent-volumes.tssrc/logs/log-streamer.tssrc/ssl-bump.tssrc/logs/log-aggregator.tssrc/services/cli-proxy-service.tssrc/upstream-proxy.tssrc/squid-config.tssrc/pid-tracker.tssrc/logs/log-formatter.tssrc/services/agent-service.tssrc/domain-patterns.tssrc/services/agent-environment.tssrc/config-file.tssrc/rules.tssrc/host-env.tssrc/compose-generator.tssrc/services/api-proxy-service.tssrc/option-parsers.tssrc/copilot-api-resolver.tssrc/logs/log-discovery.tssrc/logger.ts🔍 Notable Findings
src/cli.tsis nearly untested (28.6% stmts, 5.3% branches) — This 1,200+ line file is the orchestration layer for all flag parsing, validation, and command dispatch. Recent additions includevalidateFormat()andhandlePredownloadAction(). With only ~1 in 20 branches covered, any regression in argument validation would go undetected.src/host-iptables.tsbranch coverage at 74.1% — All 5 exported functions are called in tests, but ~5 branches remain uncovered. These are likely IPv6 detection paths (_resetIpv6State, ip6tables availability checks) and error recovery paths incleanupHostIptables()when rules don't exist.src/logs/log-parser.tsbranch coverage at 68.6% — Log parsing handles malformed/partial log lines from Squid. Uncovered branches are likely malformed-input paths. For a security tool, unhandled log formats could silently hide blocked/allowed traffic from reports.src/pid-tracker.tsbranch coverage at 66.7% — Despite 97% statement coverage, the low branch figure suggests conditional cleanup paths (e.g., process-already-dead, file-not-found) are not exercised, which could cause cleanup failures to go undetected.📈 Recommendations
High —
src/cli.tsintegration tests: Add tests covering the main argument parsing paths (--allow-domains,--enable-api-proxy,--dns-servers), validation functions (validateFormat,validateApiProxyConfig), and thepredownloadsubcommand. Acommandertest harness or a CLI smoke-test approach would rapidly increase branch coverage here.High —
src/host-iptables.tsIPv6 branches: MockexecSyncto simulate IPv6 unavailability in tests, covering the_resetIpv6Statepath and the ip6tables-not-found code paths insetupHostIptables(). This is security-critical: an uncovered IPv6 path could allow firewall bypass.Medium —
src/logs/log-parser.tsmalformed input paths: Add unit tests with truncated, malformed, or empty log lines to cover the remaining 31% of branches. This protects against silent log-parsing failures that would make coverage/audit reports unreliable.Low —
src/pid-tracker.tscleanup edge cases: Test theENOENT(file-not-found) and already-dead-process branches to ensure cleanup doesn't throw when called on a process that has already exited.Generated by test-coverage-reporter workflow. Trigger:
pushBeta Was this translation helpful? Give feedback.
All reactions