refactor: split docker-manager tests into focused files#2496
Conversation
Split the 5472-line docker-manager.test.ts into focused test files: utils, compose, lifecycle, and cleanup. Each file has its own mock setup and can be run independently. Closes #2474 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR reorganizes docker-manager's monolithic test suite into smaller, purpose-focused files so contributors can navigate and run targeted subsets more easily. It keeps the existing docker-manager.ts behavior under test, but redistributes that coverage across utilities, compose generation, lifecycle, and cleanup concerns.
Changes:
- Split general utility/helper tests into
docker-manager-utils.test.ts. - Kept
docker-manager-compose.test.tsfocused ongenerateDockerComposebehavior. - Moved lifecycle and cleanup/diagnostic tests into dedicated files.
Show a summary per file
| File | Description |
|---|---|
src/docker-manager-utils.test.ts |
New utility-focused tests for subnet helpers, UID/GID/home helpers, URL parsing, and GitHub env/path parsing. |
src/docker-manager-lifecycle.test.ts |
New lifecycle-focused tests for container startup/shutdown, fast kill behavior, DOCKER_HOST handling, and agent command execution. |
src/docker-manager-compose.test.ts |
Reduced the former monolithic file to generateDockerCompose-centered coverage plus related env/path integration cases. |
src/docker-manager-cleanup.test.ts |
New tests for config writing, cleanup/preservation behavior, and diagnostic log collection. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
src/docker-manager-compose.test.ts:1
- This file still imports several helpers that are no longer referenced after the split (
readGitHubPathEntries,mergeGitHubPathEntries,readGitHubEnvEntries,parseGitHubEnvFile, andreadEnvFile).npm run lintruns eslint oversrc/**/*.tswith@typescript-eslint/no-unused-varsenabled, so this import list will now fail CI until the unused names are removed.
- Files reviewed: 4/4 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
- Resolve rename conflict in docker-manager-compose.test.ts (keep split version) - Remove unused imports from docker-manager-compose.test.ts - Add parseDifcProxyHost tests to docker-manager-utils.test.ts (from #2471) - Add preserveIptablesAudit tests to docker-manager-cleanup.test.ts (from #2471) - Auto-merge log-streamer.ts refactor from #2495
Done. Merge conflicts resolved in commit
427 tests pass; the 2 |
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( PR author: @lpcox · Reviewer: Overall: PARTIAL — BYOK inference and MCP working; pre-step outputs were not substituted (GitHub Actions template vars unexpanded), so HTTP and file tests could not be fully verified.
|
|
Smoke Test Results ✅ GitHub MCP: refactor: extract runWithSignalHandling helper, refactor: extract createBaseAdapterConfig helper Overall: PASS
|
🔥 Smoke Test Results
PR: "refactor: split docker-manager tests into focused files" by @lpcox Overall: PASS
|
This comment has been minimized.
This comment has been minimized.
Chroot Runtime Version Comparison
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
This comment has been minimized.
This comment has been minimized.
Smoke Test Results — Services Connectivity
Overall: FAIL —
|
|
refactor: extract runWithSignalHandling helper GitHub MCP ❌ 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS ✅
|
Summary
Split the 5,472-line
src/docker-manager.test.tsinto 4 focused test files for easier navigation and targeted test execution.docker-manager-utils.test.tsdocker-manager-compose.test.tsdocker-manager-lifecycle.test.tsdocker-manager-cleanup.test.tsTesting
npx jest docker-manager-composeCloses #2474