[testing workflow] Disable shards when re-running failed tests (#50492)

This commit is contained in:
Adrian Moldovan 2024-08-09 11:49:19 +01:00 committed by GitHub
parent c406f1991e
commit ff347bdcd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View File

@ -213,7 +213,9 @@ jobs:
if [ "$failedTests" -gt 0 ]; then if [ "$failedTests" -gt 0 ]; then
if [ "$LAST_FAILED_RUN" == "1" ]; then if [ "$LAST_FAILED_RUN" == "1" ]; then
echo "Found failed tests, running only failed tests" echo "Found failed tests, running only failed tests"
lastRunFlag="--last-failed" # Add shard 1/1 to override the default shard value. No tests will run for shards > 1.
# The clean way would be to replace the shard flag from the command, but this also works.
lastRunFlag="--last-failed --shard=1/1"
else else
echo "Found failed tests, but LAST_FAILED_RUN is switched off. Running all tests." echo "Found failed tests, but LAST_FAILED_RUN is switched off. Running all tests."
fi fi

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
CI: Use a single shard when re-running failed tests in CI

View File

@ -1,3 +1,4 @@
/.state /.state
/test-results /test-results
/envs/_default /envs/_default
/playwright-report

View File

@ -15,7 +15,6 @@ const {
CI, CI,
DEFAULT_TIMEOUT_OVERRIDE, DEFAULT_TIMEOUT_OVERRIDE,
E2E_MAX_FAILURES, E2E_MAX_FAILURES,
PLAYWRIGHT_HTML_REPORT,
REPEAT_EACH, REPEAT_EACH,
} = process.env; } = process.env;
@ -54,9 +53,7 @@ if ( process.env.CI ) {
reporter.push( [ reporter.push( [
'html', 'html',
{ {
outputFolder: outputFolder: `${ testsResultsPath }/playwright-report`,
PLAYWRIGHT_HTML_REPORT ??
`${ testsResultsPath }/reports/playwright-report`,
open: 'on-failure', open: 'on-failure',
}, },
] ); ] );