[Coverage Report] Test Coverage Report — 2026-06-27 #5593
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-07-04T05:52:29.110Z.
|
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.
-
📊 Test Coverage Report — 2026-06-27
Overall Coverage
🛡️ Security-Critical Path Status
📋 Coverage Table (security-critical + files with any metric < 80%)
src/cli.tssrc/config-writer.tssrc/workdir-setup.tssrc/domain-patterns.tssrc/host-iptables-rules.tssrc/host-iptables-shared.tssrc/host-iptables-chain.tssrc/squid-config.tssrc/docker-manager.ts🔧 Function Audit
🔍 Notable Findings
All primary firewall enforcement paths are fully covered.
host-iptables-rules.ts,host-iptables-shared.ts,squid-config.ts, anddocker-manager.tsall reach 100% statement coverage, confirming the core network isolation and domain-ACL logic is comprehensively exercised by the test suite.domain-patterns.tshas 2 uncovered branches (89.47% branch coverage, 17/19 branches hit). These gaps are in the wildcard/subdomain-matching functions (parseDomainWithProtocol,isWildcardPattern,wildcardToRegex) that directly govern Squid ACL rules — an uncovered edge case here could silently allow blocked traffic.Branch coverage (94%) is the only below-par metric. The weakest files are
config-writer.ts(78.94%, 8 of 38 branches uncovered) andworkdir-setup.ts(79.62%, 11 of 54 branches uncovered). Both are config-generation paths, not enforcement paths, but malformed output could still degrade security posture.cli.tsshows 50% branch coverage, but the file is tiny (7 statements, 2 branches). The uncovered branch is an entry-point error/signal path that does not affect the firewall enforcement logic itself.✅ Recommendations
🔴 High — Cover uncovered branches in
domain-patterns.tsAdd targeted unit tests for the 2 uncovered branches in
parseDomainWithProtocol,isWildcardPattern, orwildcardToRegex. Focus on edge cases: empty strings, malformed protocols, double-wildcard patterns, and IPv6 literals. These functions directly determine what Squid allows or blocks — closing this gap is highest priority.🟡 Medium — Fix branch gaps in
config-writer.ts8 of 38 branches (21%) are uncovered. This module writes Squid and Docker Compose configs to disk; untested error branches could silently produce malformed configs. Identify the uncovered paths (likely error-handling and optional-field branches) via the HTML coverage report at
coverage/index.html, then add unit tests for each.🟢 Low — Close remaining branch gaps in
workdir-setup.tsandcli.tsworkdir-setup.ts(79.62%, 11 uncovered branches) handles temp-directory setup; add tests for failure scenarios (e.g., pre-existing directory, permission errors).cli.ts(50%, 1 uncovered branch) needs a test exercising its untested entry-point branch (e.g., missing argument or signal handling). Neither affects firewall enforcement, but both improve overall resilience.Generated by test-coverage-reporter workflow. Trigger:
scheduleBeta Was this translation helpful? Give feedback.
All reactions