[Test Coverage] Cover regex rules in policy-manifest and signals in log-streamer#5317
Conversation
- src/squid/policy-manifest.test.ts (new): tests deny-blocked-regex, allow-http-only-regex, allow-https-only-regex rules (lines 148-202) - src/logs/log-streamer.test.ts: adds coverage for SIGTERM error handling (lines 85-88), proc.kill on SIGINT (line 66), and enrichWithPid early return for invalid port (line 189) policy-manifest.ts: 87.5% -> 100% log-streamer.ts: 92.18% -> 100% (statements/lines) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
✨ New Files (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
Adds targeted Jest tests to bring uncovered branches in Squid policy-manifest generation and log streaming/signal handling up to full coverage, improving confidence in wildcard-regex rule emission and edge-case runtime behavior.
Changes:
- Add a new
policy-manifesttest suite covering wildcard-domain regex rule variants across allow/deny cases. - Extend
log-streamertests to cover SIGTERM vs non-SIGTERM error handling, SIGINT cleanup behavior, and invalid-port PID enrichment guards.
Show a summary per file
| File | Description |
|---|---|
src/squid/policy-manifest.test.ts |
New unit tests validating regex-rule emission and ordering in generatePolicyManifest for wildcard domain inputs. |
src/logs/log-streamer.test.ts |
Additional tests for signal handling paths and PID-enrichment invalid-port guard behavior in streamLogs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
|
@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/27877833519/job/82500217956?pr=5317 |
Fixed in commit |
|
🚀 Security Guard has started processing this pull request |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Smoke Claude passed |
|
✅ Build Test Suite completed successfully! |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Gemini completed. All facets verified. 💎 Checking safeoutputs availability |
Smoke Claude Result: PASS
Overall: PASS
|
🔬 Smoke Test ResultsPR: [Test Coverage] Cover regex rules in policy-manifest and signals in log-streamer
Overall: PASS
|
|
✅ Smoke Test: Copilot BYOK — PASS Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Test Results:
Tested by
|
🔥 Smoke Test — Copilot PAT Auth
Overall: PASS Auth mode: PAT (COPILOT_GITHUB_TOKEN)
|
Smoke Test Results
Running in direct BYOK mode via api-proxy → Azure OpenAI (Foundry, o4-mini-aw). Overall: PASS
|
|
Merged PRs:\n- perf(security-guard): prioritize security-relevant files in PR diff\n- fix(smoke-claude): raise turn budget to 8 and fix add_comment usage\n- GitHub page title: ✅\n- File write/read: ✅\n- Build: ✅\n- Discussion comment: ✅\n- PR comment: ✅\n- Label: ✅\nOverall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: Gemini Engine Validation
Overall Status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
|
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) PASS
|
Smoke Test: API Proxy OpenTelemetry Tracing
All scenarios pass. OTEL tracing integration is healthy.
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results
DNS resolves Overall: FAIL
|
Improves test coverage for two files that had uncovered branches.
Changes
src/squid/policy-manifest.test.ts(new file)Adds 14 tests covering the three previously-uncovered branch groups in
generatePolicyManifest:blockedDomainswith wildcard patterns (e.g.*.evil.com)deny-blocked-regex(redacted) prefixed wildcard domains (e.g.(redacted)allow-http-only-regexhttps://prefixed wildcard domains (e.g.https://*.secure.com)allow-https-only-regexEach section verifies the rule is emitted, its
action/protocol/aclNameare correct, and that it does not appear when the condition isn't met.src/logs/log-streamer.test.ts(updated)Adds 5 tests and imports
PassThroughto cover:{ signal: 'SIGTERM' }, asserts the function resolves (not throws).proc.kill('SIGTERM')called from cleanup: uses aPassThroughstdout that stays open, emitsSIGINTviaprocess.emitafter setup, verifieskillis called.enrichWithPidearly-return for invalid port: exercises both port0(≤ 0) and port99999(> 65535), assertstrackPidForPortSyncis not called.Coverage delta
src/squid/policy-manifest.tssrc/logs/log-streamer.ts