[Test Coverage] container-lifecycle missing branch coverage#5743
Conversation
Cover uncovered branches in container-lifecycle.ts: - fastKillAgentContainer: custom stop timeout propagated to docker stop - fastKillAgentContainer: docker stop errors are swallowed (best-effort) - runAgentCommand: externally-killed agent with docker wait returning 0 exercises the `exitCode || 143` normalisation branch - startContainers: compose-down cleanup throws before retry; catch block swallows the error and proceeds with the retry successfully - startContainers: cli-proxy fails during the one-shot retry (triggered by an api-proxy/squid first-attempt failure); the specific cli-proxy error message is surfaced rather than falling through to Squid diagnostics Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new Jest test suite to exercise previously uncovered branches in src/container-lifecycle.ts, specifically around retry/cleanup behavior, externally-killed agent exit-code normalization, and docker stop timeout propagation.
Changes:
- Added 9 branch-coverage tests for
fastKillAgentContainer,runAgentCommand, andstartContainers. - Validates stop-timeout forwarding and hard-deadline computation for
docker stop -t. - Adds retry-path tests for compose-down cleanup failures and cli-proxy failure surfacing.
Show a summary per file
| File | Description |
|---|---|
src/container-lifecycle-missing-branches.test.ts |
New Jest tests targeting uncovered branches in container-lifecycle.ts retry/cleanup and externally-killed behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
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 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Contribution Check completed successfully! Contribution check complete for PR #5743: the PR follows the applicable CONTRIBUTING.md guidelines, so no comment is needed. |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Build Test Suite completed successfully! |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
🚀 Security Guard has started processing this pull request |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 98.65% | 98.68% | 📈 +0.03% |
| Statements | 98.53% | 98.57% | 📈 +0.04% |
| Functions | 99.55% | 99.55% | ➡️ +0.00% |
| Branches | 94.48% | 94.46% | 📉 -0.02% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/compose-generator.ts |
99.0% → 99.1% (+0.03%) | 97.2% → 97.3% (+0.08%) |
src/workdir-setup.ts |
92.7% → 94.5% (+1.82%) | 92.7% → 94.5% (+1.82%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test: Claude Engine Validation
Overall result: PASS ✅
|
🔥 Smoke Test Results
PR: [Test Coverage] container-lifecycle missing branch coverage Overall: PASS ✅
|
🔬 Smoke Test: Copilot PAT Auth — PASS
Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN) PR by
|
🔍 Smoke Test: API Proxy OpenTelemetry Tracing
Overall: ✅ All validatable scenarios pass. Scenario 5 is expected-pending (requires a live run with
|
🧪 Chroot Version Comparison Results
Overall: ❌ Tests did not pass — Python and Node.js versions differ between host and chroot environments.
|
|
|
Smoke Test: Copilot BYOK (Direct) Mode✅ GitHub MCP connectivity Status: PASS CC:
|
|
PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Gemini Engine Validation
Overall status: PASS Last 2 merged PRs:
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: GitHub Actions Services Connectivity
Overall: FAIL —
|
|
|
Adds 9 new Jest tests in
src/container-lifecycle-missing-branches.test.tstargeting branches incontainer-lifecycle.tsthat were not exercised by the existingcontainer-start.test.tsandrun-agent-command.test.tssuites.What's covered
fastKillAgentContainerdocker stop -tand the hard-deadline is(N+5)*1000 msfastKillAgentContainerexitCode || 143normalisationrunAgentCommanddocker waitreturns0must exit with143, not0startContainerscatch (cleanupError)block is hit whenrunComposeDownrejects; retry still proceedsstartContainersTest results