Deduplicate writeConfigs test setup in config-writer.test.ts#4054
Conversation
writeConfigs test setup in config-writer.test.ts
There was a problem hiding this comment.
Pull request overview
Refactors src/config-writer.test.ts to deduplicate repeated writeConfigs(...) option objects by introducing a shared buildWriteConfig(overrides?) helper, making the test suite easier to maintain when the writeConfigs config shape evolves.
Changes:
- Added
buildWriteConfighelper to centralize the canonical defaultwriteConfigsoptions for this suite. - Updated test call sites to use
writeConfigs(buildWriteConfig({...overrides}))instead of repeating full config objects.
Show a summary per file
| File | Description |
|---|---|
src/config-writer.test.ts |
Introduces a shared config builder and replaces repeated inline writeConfigs option objects with override-based calls. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
✨ New Files (1 files)
Coverage comparison generated by |
Smoke Test: Claude Engine
Total: PASS
|
🔬 Smoke Test Results
PR: Deduplicate Overall: PARTIAL — GitHub MCP confirmed working; pre-step data not injected.
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PASS — PR by
|
Gemini Smoke Test Results\n- GitHub MCP Testing: ❌\n- GitHub.com Connectivity: ❌\n- File Writing Testing: ✅\n- Bash Tool Testing: ✅\n\nOverall status: FAILWarning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results: FAIL
Overall: FAIL
|
|
Remove 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.
|
src/config-writer.test.tsrepeated the samewriteConfigsbase config object across many tests, making updates to config shape expensive and error-prone. This refactor centralizes the shared setup while preserving each test’s specific overrides.Refactor: shared base config builder
buildWriteConfig(overrides?)in thewriteConfigstest suite to define the canonical default config once.Call site cleanup
writeConfigs({...})objects withwriteConfigs(buildWriteConfig(...)).overrides(e.g.sslBump,workDir,geminiApiKey,auditConfig, URL/API-proxy fields).Maintainability impact