Fix intermittent iOS test execution in CI workflow by ensuring simulator availability #332
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.
Problem
The
test_iosjob in the Node.js CI workflow was intermittently passing without actually running tests. In these cases, the job would complete successfully but the logs showed:This meant that while the job appeared green, no actual iOS tests were being executed. For example, this run passed without running tests, while this earlier run on the same PR actually ran the tests and caught real failures.
Root Cause
The
react-native run-ioscommand requires an iOS simulator to be available and booted before it can execute. The workflow was runningreact-native run-ioswithout explicitly ensuring a simulator was ready, leading to intermittent failures when no simulator happened to be available or booted on the GitHub Actions runner.Solution
This PR adds explicit simulator management steps before running iOS tests:
jqfor reliable parsingImplementation Details
The simulator boot script uses:
xcrun simctl list devices available -j) withjqparsing for reliable simulator ID extractionThis ensures that:
Testing
The changes have been validated with CodeQL security scanning (0 alerts) and follow GitHub Actions best practices for macOS runners where
jqis pre-installed.Original prompt
💡 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.