You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overall coverage is strong. No files fall below 50% statement coverage.
🔴 Critical Gaps (< 50% statement coverage)
None — all files are above 50%.
🟡 Low Coverage (50–79% statement coverage)
File
Stmts
Branch
Funcs
Uncovered Lines
src/commands/validators/network-options.ts
66.66%
50%
100%
48-51, 60, 65-74
🛡️ Security-Critical Path Status
File
Stmts
Branch
Funcs
Lines
src/host-iptables.ts
100%
100%
100%
100% ✅
src/host-iptables-rules.ts
97.67%
96.82%
100%
97.63% ✅
src/host-iptables-shared.ts
100%
95%
100%
100% ✅
src/squid-config.ts
100%
100%
100%
100% ✅
src/docker-manager.ts
100%
100%
100%
100% ✅
src/domain-patterns.ts
97.67%
95.38%
100%
97.61% ✅
src/cli.ts
85.71%
50%
100%
85.71% ⚠️
📋 Notable Findings
src/cli.ts — branch coverage at 50% (line 12 uncovered). This is the main orchestration entry point. The uncovered branch likely guards an early-exit or import-time condition that is hard to exercise in unit tests. Worth reviewing whether the branch can be covered with an integration-style test or if it is dead code.
src/commands/validators/network-options.ts — lowest coverage in the codebase (66.7% stmts, 50% branch, lines 48–74). This validator is invoked at startup to check user-supplied network options. Uncovered branches here could allow malformed input to bypass validation silently.
src/logs/log-parser.ts — 86.9% stmts, 67.1% branch (lines 180–202 uncovered). Log parsing is used for the awf logs commands. Uncovered paths suggest certain malformed or edge-case log line formats are not tested, which could cause silent parse failures during audit/reporting.
src/logs/audit-enricher.ts — 83.6% stmts, 74.1% branch (lines 67, 103, 116, 144, 177 uncovered). Used by awf logs audit to enrich log entries. Multiple scattered uncovered lines suggest error-handling paths for unexpected log shapes are missing.
One failing test: src/services/agent-volumes-mounts.test.ts — test should pre-resolve allowed domains into chroot-hosts file fails because the DNS resolution in CI returns different IPs than the hardcoded expected values (140.82.121.4 for github.com, 104.16.22.35 for npmjs.org). This test is brittle against DNS changes and should mock DNS resolution instead of relying on live lookups.
📈 Recommendations
High — Fix brittle DNS test in agent-volumes-mounts.test.ts: The failing test hardcodes real IP addresses for github.com and npmjs.org. Mock the DNS resolver to return stable values. This is a CI reliability issue that will recur whenever IPs rotate.
High — Improve src/commands/validators/network-options.ts branch coverage (50%): Add tests for the validation paths on lines 48–74 covering invalid/edge-case network option values. A validator with 50% branch coverage in a security tool is a gap worth closing.
Medium — Cover uncovered log-parsing paths in src/logs/log-parser.ts (lines 180–202): Add unit tests for malformed or truncated Squid log lines. These paths are triggered by real-world log corruption and currently have no test coverage.
Low — Address src/cli.ts line 12: Investigate whether the uncovered line is reachable or dead code. If reachable, add a test; if dead, remove it to keep coverage metrics meaningful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Overall Coverage
Overall coverage is strong. No files fall below 50% statement coverage.
🔴 Critical Gaps (< 50% statement coverage)
None — all files are above 50%.
🟡 Low Coverage (50–79% statement coverage)
src/commands/validators/network-options.ts🛡️ Security-Critical Path Status
src/host-iptables.tssrc/host-iptables-rules.tssrc/host-iptables-shared.tssrc/squid-config.tssrc/docker-manager.tssrc/domain-patterns.tssrc/cli.ts📋 Notable Findings
src/cli.ts— branch coverage at 50% (line 12 uncovered). This is the main orchestration entry point. The uncovered branch likely guards an early-exit or import-time condition that is hard to exercise in unit tests. Worth reviewing whether the branch can be covered with an integration-style test or if it is dead code.src/commands/validators/network-options.ts— lowest coverage in the codebase (66.7% stmts, 50% branch, lines 48–74). This validator is invoked at startup to check user-supplied network options. Uncovered branches here could allow malformed input to bypass validation silently.src/logs/log-parser.ts— 86.9% stmts, 67.1% branch (lines 180–202 uncovered). Log parsing is used for theawf logscommands. Uncovered paths suggest certain malformed or edge-case log line formats are not tested, which could cause silent parse failures during audit/reporting.src/logs/audit-enricher.ts— 83.6% stmts, 74.1% branch (lines 67, 103, 116, 144, 177 uncovered). Used byawf logs auditto enrich log entries. Multiple scattered uncovered lines suggest error-handling paths for unexpected log shapes are missing.One failing test:
src/services/agent-volumes-mounts.test.ts— testshould pre-resolve allowed domains into chroot-hosts filefails because the DNS resolution in CI returns different IPs than the hardcoded expected values (140.82.121.4forgithub.com,104.16.22.35fornpmjs.org). This test is brittle against DNS changes and should mock DNS resolution instead of relying on live lookups.📈 Recommendations
High — Fix brittle DNS test in
agent-volumes-mounts.test.ts: The failing test hardcodes real IP addresses forgithub.comandnpmjs.org. Mock the DNS resolver to return stable values. This is a CI reliability issue that will recur whenever IPs rotate.High — Improve
src/commands/validators/network-options.tsbranch coverage (50%): Add tests for the validation paths on lines 48–74 covering invalid/edge-case network option values. A validator with 50% branch coverage in a security tool is a gap worth closing.Medium — Cover uncovered log-parsing paths in
src/logs/log-parser.ts(lines 180–202): Add unit tests for malformed or truncated Squid log lines. These paths are triggered by real-world log corruption and currently have no test coverage.Low — Address
src/cli.tsline 12: Investigate whether the uncovered line is reachable or dead code. If reachable, add a test; if dead, remove it to keep coverage metrics meaningful.📋 Full Coverage Table
Click to expand per-file coverage
Generated by test-coverage-reporter workflow. Trigger:
push. Test suite: 2315 tests (2314 passed, 1 failed), 108 suites.Beta Was this translation helpful? Give feedback.
All reactions