Fix Windows PowerShell compatibility in reference server tests #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
test-reference-server.ymlworkflow was failing on Windows with the error:This occurred because the workflow used bash-specific syntax (
SERVER_PID=$!,kill $SERVER_PID) in the "Start server (smoke test)" step, which doesn't work in PowerShell on Windows runners.Solution
Replaced the bash-specific inline server lifecycle management with the existing cross-platform Node.js tests that properly handle server startup and shutdown using
child_process.spawn().Key Changes
Removed bash-specific workflow step: Eliminated 20 lines of bash code that used
npm start &,SERVER_PID=$!, andkill $SERVER_PIDEnhanced existing npm test: Modified the "Test reference server" step to run without
continue-on-error, making it the primary test mechanismFixed Node.js test file: Updated
reference-server/test/server.test.jsto:statusandtimestampfields)test/**/*.test.jstotest/*.test.jsBefore vs After
Before (bash-specific):
After (cross-platform):
The Node.js test properly manages server lifecycle using
spawn('npm', ['start'])andserver.kill('SIGTERM'), which works consistently across all platforms.Testing
Verified the complete workflow sequence passes on Linux:
This solution follows the repository's "script-first approach" philosophy where workflows call scripts that can be run locally, enabling easier debugging and development.
Fixes #5.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.