This adds a new test runner for running tests in parallel (It is in the menu at the top of the test explorer that includes test coverage).
Because parallel testing doesn't produce a parseable output by default, I have to use --xunit-output to output xUnit XML. This is then parsed using the xml2js module.
There are a couple of issues with this as is
Skipped tests are indicated as passed in the xUnit XML.
When running swift test --parallel failed test output does not have any newlines. So I can't parse out error messages. This is fixed on swift main, so will be resolved in Swift 6.
The last time I checked running swift test using execFile on Windows does not work, so parallel testing will not be available on Windows in a similar way coverage isn't available.
Because of the first two issues I am considering making this feature only available in Swift 6 onwards, just so we don't release a half arsed solution.
This adds a new test runner for running tests in parallel (It is in the menu at the top of the test explorer that includes test coverage). Because parallel testing doesn't produce a parseable output by default, I have to use
--xunit-output
to output xUnit XML. This is then parsed using thexml2js
module.There are a couple of issues with this as is
swift test --parallel
failed test output does not have any newlines. So I can't parse out error messages. This is fixed on swift main, so will be resolved in Swift 6.swift test
usingexecFile
on Windows does not work, so parallel testing will not be available on Windows in a similar way coverage isn't available.Because of the first two issues I am considering making this feature only available in Swift 6 onwards, just so we don't release a half arsed solution.