Skip to content

test: split config-file tests by config lifecycle phase#3699

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-config-file-test
May 25, 2026
Merged

test: split config-file tests by config lifecycle phase#3699
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-config-file-test

Conversation

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor

src/config-file.test.ts had grown into a single 783-line suite covering multiple lifecycle phases, making phase-specific coverage harder to navigate. This change reorganizes those tests into phase-aligned files without changing assertions or production behavior.

  • Validation phase

    • Moved validateAwfFileConfig coverage to src/config-file-validation.test.ts.
    • Keeps schema/type/unsupported-key and edge-case validation checks together.
  • Loading phase

    • Moved loadAwfFileConfig coverage to src/config-file-loading.test.ts.
    • Consolidates file/stdin parsing, extension handling, and validation-error-path assertions.
  • Mapping phase

    • Moved mapAwfFileConfigToCliOptions coverage to src/config-file-mapping.test.ts.
    • Centralizes config→CLI transformation expectations (targets, security, container, env, logging, rate limits).
  • Precedence phase

    • Moved applyConfigOptionsInPlaceWithCliPrecedence coverage to src/config-file-precedence.test.ts.
    • Isolates CLI-over-file precedence semantics and undefined-value behavior.
  • Repository change shape

    • Removed src/config-file.test.ts.
    • Added four focused test files aligned to the config processing pipeline.
// Before
describe('config-file', () => {
  describe('validateAwfFileConfig', ...)
  describe('loadAwfFileConfig', ...)
  describe('mapAwfFileConfigToCliOptions', ...)
  describe('applyConfigOptionsInPlaceWithCliPrecedence', ...)
})

// After
// src/config-file-validation.test.ts
describe('validateAwfFileConfig', ...)

// src/config-file-loading.test.ts
describe('loadAwfFileConfig', ...)

// src/config-file-mapping.test.ts
describe('mapAwfFileConfigToCliOptions', ...)

// src/config-file-precedence.test.ts
describe('applyConfigOptionsInPlaceWithCliPrecedence', ...)

Copilot AI changed the title [WIP] Refactor config-file.test.ts by splitting into lifecycle phases test: split config-file tests by config lifecycle phase May 25, 2026
Copilot finished work on behalf of lpcox May 25, 2026 03:05
Copilot AI requested a review from lpcox May 25, 2026 03:05
@lpcox lpcox marked this pull request as ready for review May 25, 2026 03:14
Copilot AI review requested due to automatic review settings May 25, 2026 03:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the previously large src/config-file.test.ts suite into four smaller, phase-aligned test files to make config lifecycle coverage easier to navigate, without changing production behavior or test assertions.

Changes:

  • Split validation tests into src/config-file-validation.test.ts.
  • Split loading/parsing tests into src/config-file-loading.test.ts.
  • Split mapping and CLI precedence tests into src/config-file-mapping.test.ts and src/config-file-precedence.test.ts, and removed the old monolithic test file.
Show a summary per file
File Description
src/config-file.test.ts Removes the monolithic config-file test suite in favor of phase-focused test files.
src/config-file-validation.test.ts Houses validateAwfFileConfig tests (schema/type/unsupported key validation and edge cases).
src/config-file-loading.test.ts Houses loadAwfFileConfig tests (JSON/YAML/stdin parsing and validation error surfacing).
src/config-file-mapping.test.ts Houses mapAwfFileConfigToCliOptions tests (config-to-CLI transformation expectations).
src/config-file-precedence.test.ts Houses applyConfigOptionsInPlaceWithCliPrecedence tests (CLI-over-file precedence behavior).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.36% 96.43% 📈 +0.07%
Statements 96.21% 96.28% 📈 +0.07%
Functions 97.96% 97.96% ➡️ +0.00%
Branches 90.35% 90.39% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 83.0% → 85.6% (+2.54%) 83.0% → 85.6% (+2.54%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results ✅

  • GitHub API: ✅ PASS — 2 recent PRs verified
  • GitHub Check: ✅ PASS — playwright_check verified
  • File Verify: ✅ PASS — smoke test file present

Overall: ✅ PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Offline) Mode

Status: PARTIAL PASS ⚠️

  • ✅ GitHub MCP: Retrieved PR Reduce Documentation Maintainer workflow prompt/tool overhead #3704 ("Reduce Documentation Maintainer workflow prompt/tool overhead")
  • ⚠️ GitHub.com connectivity: Pre-step variables not expanded
  • ⚠️ File write/read: Test file not found (variables not expanded)
  • BYOK inference: Successfully responding via api-proxy sidecar

Note: Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com

PR Context: Author @Copilot, Assignees: @lpcox @Copilot

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

GitHub MCP — PR #3689: fix(api-proxy): generalize deprecated header stripping
File Write/Read — File not found at expected path
GitHub.com Connectivity — No pre-computed HTTP status available

Overall: FAIL

@Copilot @lpcox

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Codex: FAIL
Merged PRs: ✅ fix(api-proxy): generalize deprecated header stripping for any provider/header; [Test Coverage] Add comprehensive tests for config-assembly validator
SafeInputs GH CLI: ❌ safeinputs-gh unavailable; queried via gh: Reduce Documentation Maintainer workflow prompt/tool overhead; [WIP] Refactor proxyRequest function to extract nested callbacks
Playwright: ✅ GitHub title verified
Tavily: ❌ Tavily bridge has no registered tools
File/Bash: ✅ file created and read
Discussion: ❌ github-discussion-query unavailable; oracle comment posted to #3705 via safeoutputs
Build: ✅ npm ci && npm run build
Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

Service Connectivity Test Results

Redis: Connection timeout (no response from host.docker.internal:6379)
PostgreSQL pg_isready: No response from host.docker.internal:5432
PostgreSQL SELECT 1: Not tested (connection failed)

Overall Result: FAIL

Services running on host are not reachable from AWF sandbox via host.docker.internal.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Test Results

This test verifies that runtime versions inside the chrooted agent container match the host environment.

Runtime Host Version Chroot Version Match?
Python 3.12.13 3.12.3 ❌ NO
Node.js v24.15.0 v22.22.3 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall Result: ❌ FAILED

The chroot environment does not have matching versions for all runtimes. This indicates that the agent container is not perfectly mirroring the host environment, which may affect reproducibility and compatibility.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

All build tests completed successfully across 8 ecosystems!

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx 1/1 passed ✅ PASS
Node.js execa 1/1 passed ✅ PASS
Node.js p-limit 1/1 passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

All projects successfully cloned, built/installed dependencies, and passed their tests. The AWF firewall correctly handled network access for all tested language ecosystems.

Generated by Build Test Suite for issue #3699 · ● 12.1M ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results\n\n- GitHub MCP: ❌\n- Connectivity: ❌\n- File Writing: ✅\n- Bash Tool: ✅\n\nFAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@lpcox lpcox merged commit fef4d08 into main May 25, 2026
70 of 72 checks passed
@lpcox lpcox deleted the copilot/refactor-split-config-file-test branch May 25, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactoring] Split config-file.test.ts by config lifecycle phase

3 participants