refactor: split coverage-improvements.test.ts into per-module test files#6036
Conversation
- src/logs/log-parser-branches.test.ts (~160 lines) - src/workdir-setup-branches.test.ts (~195 lines) - src/commands/network-setup-branches.test.ts (~95 lines) - src/domain-validation-branches.test.ts (~135 lines) All 30 tests pass. Closes #6011
There was a problem hiding this comment.
Pull request overview
This PR refactors the previously monolithic src/coverage-improvements.test.ts into smaller, module-focused branch-coverage test files co-located with the code they exercise, improving failure localization and test maintainability without changing production behavior.
Changes:
- Deleted
src/coverage-improvements.test.ts(651 lines) to remove the catch-all coverage file. - Added four per-module “*-branches.test.ts” files that preserve the prior branch-coverage intent while making ownership and placement clearer.
- Kept Jest discovery behavior unchanged by using existing
**/*.test.tsnaming/globs.
Show a summary per file
| File | Description |
|---|---|
| src/workdir-setup-branches.test.ts | Adds targeted branch-coverage tests for src/workdir-setup.ts error/else branches and chroot-home warning behavior. |
| src/logs/log-parser-branches.test.ts | Adds targeted branch-coverage tests for src/logs/log-parser.ts parsing edge cases. |
| src/domain-validation-branches.test.ts | Adds targeted branch-coverage tests around preflight domain allow/block resolution behavior with mocked validators/parsers. |
| src/commands/network-setup-branches.test.ts | Adds targeted branch-coverage tests for src/commands/network-setup.ts error and env-branch handling. |
| src/coverage-improvements.test.ts | Removes the previous aggregated coverage test file in favor of focused replacements. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Low
|
@copilot address review feedback |
Fixed in 68aeb31. Both |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
❌ Contribution Check failed. Please review the logs for details. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Smoke Claude passed |
|
✅ Build Test Suite completed successfully! |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
🚀 Security Guard has started processing this pull request |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test: Claude Engine Validation
Overall result: PASS ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Services Connectivity
Overall: FAIL
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔍 Smoke Test Results
Overall: PASS (MCP connected; CI template vars not substituted for other checks) CC Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK ModeTest Results:
Status: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Chroot Version Comparison
Result: Not all versions matched. Go matches, but Python (3.12.13 vs 3.12.3) and Node.js (v24.18.0 vs v22.23.1) differ between host and chroot environments. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"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.
|
Smoke Test: API Proxy OpenTelemetry Tracing
Summary: Core OTEL module and test suite are working correctly. Env var forwarding to the api-proxy container is the remaining expected-pending item for development completion. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔬 Smoke Test: Copilot PAT Auth
Overall: PASS | Auth mode: PAT (COPILOT_GITHUB_TOKEN) Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test
Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"
- "registry.npmjs.org"See Network Configuration for more information.
|
src/coverage-improvements.test.tswas a 651-line catch-all accumulating branch-coverage tests for four unrelated modules, making failures hard to localize and new tests hard to place.Changes
src/coverage-improvements.test.tssrc/logs/log-parser-branches.test.tssrc/logs/log-parser.tssrc/workdir-setup-branches.test.tssrc/workdir-setup.tssrc/commands/network-setup-branches.test.tssrc/commands/network-setup.tssrc/domain-validation-branches.test.tssrc/commands/preflight.ts/src/domain-validation.tsNo production code changed. All 30 tests pass. Jest discovers the new files automatically via existing glob patterns — no config changes needed.