This issue tracks the critical CI environment problem blocking all test coverage improvement work.
Problem
The GitHub Actions CI environment is missing the /etc/hosts file, which causes DNS resolution failures when Vitest attempts to resolve localhost. This manifests as:
Error: getaddrinfo EAI_AGAIN localhost
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:internal/dns/promises:86:17)
Impact
Currently Blocked:
Coverage Status:
- ✅ 0% of JavaScript/TypeScript code can be tested in CI
- ⚠️ Python tests also blocked (different issue: import errors)
- ⚠️ No coverage measurement possible
Root Cause
The CI container lacks /etc/hosts, preventing hostname resolution. Vitest's internal test server requires localhost DNS resolution during startup, even for basic test execution.
Proposed Solution
Add /etc/hosts setup to the daily-test-improver workflow before running tests:
- name: Setup /etc/hosts for DNS resolution
run: |
sudo bash -c 'echo "127.0.0.1 localhost" > /etc/hosts'
sudo bash -c 'echo "::1 localhost" >> /etc/hosts'
cat /etc/hosts
This should be added to the main workflow file (.github/workflows/daily-test-improver.yml), NOT in the coverage-steps action (which runs in composite mode without elevated permissions).
Alternative Solutions
If sudo is not available:
Option 1: Configure Vitest to not use localhost
- May require Vitest configuration changes
- Research needed on feasibility
Option 2: Use different test runner
- Switch from Vitest to Jest
- More invasive change
Option 3: Run tests differently
- Use
NODE_OPTIONS or environment variables
- May not work given where failure occurs
Verification
Once fixed, all 4 open test PRs should immediately pass. Each contains well-structured tests ready to execute.
Files Needing Update
.github/workflows/daily-test-improver.yml - Add /etc/hosts setup step before calling coverage-steps action
.github/actions/daily-test-improver/coverage-steps/action.yml - Already updated to use Node 20 (separate fix)
Priority
High - Blocks all test coverage improvement work, which is the core purpose of the daily-test-improver workflow.
AI generated by Daily Test Coverage Improver
To add this workflow in your repository, run gh aw add githubnext/agentics/workflows/daily-test-improver.md@e43596e069e74a65cd7d93315091672d278c2642. See usage guide.
This issue tracks the critical CI environment problem blocking all test coverage improvement work.
Problem
The GitHub Actions CI environment is missing the
/etc/hostsfile, which causes DNS resolution failures when Vitest attempts to resolvelocalhost. This manifests as:Impact
Currently Blocked:
Coverage Status:
Root Cause
The CI container lacks
/etc/hosts, preventing hostname resolution. Vitest's internal test server requires localhost DNS resolution during startup, even for basic test execution.Proposed Solution
Add
/etc/hostssetup to the daily-test-improver workflow before running tests:This should be added to the main workflow file (
.github/workflows/daily-test-improver.yml), NOT in the coverage-steps action (which runs in composite mode without elevated permissions).Alternative Solutions
If sudo is not available:
Option 1: Configure Vitest to not use localhost
Option 2: Use different test runner
Option 3: Run tests differently
NODE_OPTIONSor environment variablesVerification
Once fixed, all 4 open test PRs should immediately pass. Each contains well-structured tests ready to execute.
Files Needing Update
.github/workflows/daily-test-improver.yml- Add /etc/hosts setup step before calling coverage-steps action.github/actions/daily-test-improver/coverage-steps/action.yml- Already updated to use Node 20 (separate fix)Priority
High - Blocks all test coverage improvement work, which is the core purpose of the daily-test-improver workflow.