Skip to content

Commit 5e5b59e

Browse files
committed
fix: add retry logic and npm cache cleanup for Windows tests
- Clear npm cache on Windows before tests to avoid lock corruption - Add retry logic (3 attempts) for CLI test to handle transient issues - Use nick-fields/retry@v3 action for robust test execution This addresses intermittent npm cache corruption errors on Windows runners. Fixes #4 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 21e382b commit 5e5b59e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,18 @@ jobs:
8686
- name: Install package
8787
run: uv sync
8888

89+
- name: Clear npm cache on Windows
90+
if: runner.os == 'Windows'
91+
run: npm cache clean --force
92+
continue-on-error: true
93+
8994
- name: Test CLI can be invoked
90-
run: uv run promptfoo --version
95+
uses: nick-fields/retry@v3
96+
with:
97+
timeout_minutes: 3
98+
max_attempts: 3
99+
retry_on: error
100+
command: uv run promptfoo --version
91101

92102
- name: Test Node.js detection
93103
run: uv run python -c "from promptfoo.cli import check_node_installed, check_npx_installed; assert check_node_installed(); assert check_npx_installed()"

0 commit comments

Comments
 (0)