Repository navigation
Run the PowerShell tests in CI under 5.1 and 7 - #108
Conversation
windows/README.md said tests\windows_pools_test.ps1 was exercised in CI under both shells, but no workflow ran any test script; powershell-parse only parses. Add powershell-tests.yml, which runs every tests\*_test.ps1 on windows-latest under Windows PowerShell 5.1 and PowerShell 7, as two named steps with exit $LASTEXITCODE, mirroring powershell-parse.yml. Tests are found by glob, so #101's install_python_toolcache_test.ps1 (PR #102) is picked up without a workflow edit. Each runs in a child process of the step's own shell, so env changes and stale $LASTEXITCODE can't leak between tests. Closes #103 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
DeepSeek AI Code Review1. Acceptance criteria
All three AC items are met. 2. Bugs and logic errors
3. CLI and API safety
4. Test coverage
5. Suggested follow-up issues
REQUEST CHANGES — Reviewed by DeepSeek via deepseek-pr-review.yml. Advisory only. |
GPT AI Code ReviewSkipped: API key not configured The To enable GPT reviews, add
Once the secret is configured, re-run this workflow or push a new commit to trigger a fresh review. REVIEW SKIPPED - API KEY NOT CONFIGURED Reviewed by GPT via gpt-pr-review.yml. Advisory only. |
Closes #103
Why
windows/README.md(andtests/windows_pools_test.ps1's header) said the Windows pool tests are "exercised in CI" under bothpwshandpowershell.exe. Nothing ran them.powershell-parse.ymlparses every.ps1but executes none, so a runtime regression, or a cmdlet or parameter that exists only in 7 (which the parse check says it can't catch), would go green.What
.github/workflows/powershell-tests.yml: onwindows-latest, one step forshell: powershell(5.1) and one forshell: pwsh(7). Same style aspowershell-parse.yml: two named steps rather than a matrix,exit $LASTEXITCODEafter the script call, and the 7 step runs even if 5.1 failed (!cancelled())..github/scripts/Invoke-PowerShellTests.ps1: runs everytests\*_test.ps1.tests/install_python_toolcache_test.ps1from Stop Install-PythonToolCache.ps1 silently installing nothing over an orphaned registration #102 is covered as soon as it merges, whichever PR lands first. A glob that matches nothing is an error.(Get-Process -Id $PID).Path -File, as the README documents). The tests change process-wide env (PSModulePath,COMPUTERNAME, fake-ghswitches), and the pools test ends without an explicitexit 0, so running them in-process could leak state between tests and report a stale$LASTEXITCODE.windows/README.md: the claim is now true. It names the workflow and says new tests are picked up automatically.Verified locally (Windows PS 5.1.26100 and pwsh 7.6.6)
tests/windows_pools_test.ps1onmain: exit 0, 72/72 checks, under both shells, run directly and through the runner.tests/install_python_toolcache_test.ps1, run from that branch: all checks pass under both shells.exit 3, and an uncaughtthrow), then deleted them. The runner exited 1 under both shells, reported both failures, and still ran and passed the real test.🤖 Generated with Claude Code