[Coverage Report] Test Coverage Report — 2026-05-09 #2815
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-05-16T23:36:05.249Z.
|
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
🔴 Critical Gaps (< 50% statement coverage)
src/cli.tscli.tsis the main entry point and orchestration layer — it coordinates argument parsing, container lifecycle, and signal handling, yet only 11.6% of its functions are exercised. This is the single largest coverage risk.🟡 Low Coverage (50–79%)
src/container-cleanup.tsBranch coverage for
container-cleanup.tsis extremely low (5.3%) despite 100% function coverage — conditional error-handling paths are almost entirely untested.🛡️ Security-Critical Path Status
src/host-iptables.tssrc/squid-config.tssrc/docker-manager.tssrc/domain-patterns.tshost-iptables.tshas solid statement coverage but branch coverage at 74.1% — some conditional iptables rule paths (e.g. IPv6 handling, optionalapiProxyIp/dohProxyIp,hostAccessconfigs) are not fully exercised.📋 Full Per-File 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/cli-workflow.tssrc/services/doh-proxy-service.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/services/api-proxy-service.tssrc/compose-generator.tssrc/option-parsers.tssrc/api-proxy-config.tssrc/docker-manager.tssrc/domain-utils.tssrc/dlp.tssrc/squid-config.ts🔍 Notable Findings
src/cli.ts— entry point almost untested (28.6% stmt, 5.3% branch): The main orchestration function, signal handlers (SIGINT/SIGTERM), and most CLI sub-command actions lack test coverage. Given 105 source files changed in the past 7 days and many additions flowing throughcli.ts, this gap is growing.src/container-cleanup.ts— error branches dark (77.1% stmt, 5.3% branch): Every function is called at least once, but conditional error paths (e.g. Docker API failures, timeout handling) are essentially untested. These are exactly the paths that matter during incident recovery.src/host-iptables.ts— optional parameter branches uncovered (88.5% stmt, 74.1% branch):setupHostIptablesaccepts optionalapiProxyIp,dohProxyIp,hostAccess, andcliProxyConfigparameters. Combinations of these flags likely contain untested iptables rule generation paths that directly affect network isolation correctness.src/logs/log-parser.ts— branch coverage 68.6%: Log parsing is exercised for happy paths, but malformed log line handling and edge-case timestamp/field formats are not covered. Incorrect parsing here could silently drop or mis-attribute firewall events.📈 Recommendations
High —
cli.tsintegration tests: Add integration-style tests using Commander's.parseAsync()with mockedDockerManager/startContainersto cover the main action handler,--help, signal handling, and error exits. This is the fastest lever for overall coverage improvement.High —
container-cleanup.tserror injection: The branch gap (5.3%) means virtually no error-path testing. Add unit tests that mockexecato throw/reject, covering Docker removal failures, network teardown errors, and timeout scenarios.Medium —
host-iptables.tsoptional parameter combinations: Add parameterized tests forsetupHostIptablescovering:apiProxyIppresent/absent,dohProxyIppresent/absent, IPv6 enabled/disabled,hostAccesscustom ranges. These branches control actual firewall rules.Low —
src/logs/log-parser.tsmalformed input: Add unit tests for truncated lines, missing fields, non-numeric timestamps, and Squid log format variations to harden the audit trail.Generated by test-coverage-reporter workflow · Trigger:
push· 2026-05-09Beta Was this translation helpful? Give feedback.
All reactions