-
Notifications
You must be signed in to change notification settings - Fork 61
feat: add test runner wrapper to handle windows non-zero exit codes #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
df00dd9
fix: upgrade symfony/process lowest version to 5.4.51
xepozz d4f381e
test: handle non-zero exit codes when tests succeed
xepozz 47d5107
test: add test runner
xepozz 414cc4f
test: windows suitable path
xepozz 850e016
test: pass php exucutable
xepozz 6ca7592
test: fix xml element access
xepozz ff10ea9
test: use PHP_BINARY for passing php executable to passthru command
xepozz 8398d2d
test: rename file, add shebang
xepozz f6da77a
Merge branch 'master' into handle-exit-codes
xepozz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env php | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * Sometimes Windows CI runner fails to report test results properly. | ||
| * This script is a workaround for that. | ||
| */ | ||
|
|
||
| $command = \implode(' ', \array_slice($argv, 1)); | ||
| $logFile = 'runtime/phpunit.xml'; | ||
|
|
||
| \passthru(\sprintf("%s %s --log-junit=%s 2>&1", PHP_BINARY, $command, $logFile), $code); | ||
|
|
||
| if (\file_exists($logFile)) { | ||
| $xml = \simplexml_load_file($logFile); | ||
| $failures = (int) $xml->testsuite['failures'] + (int) $xml->testsuite['errors']; | ||
|
|
||
| if ($failures === 0) { | ||
| exit(0); | ||
| } | ||
| } | ||
|
|
||
| exit($code ?: 1); | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.