diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c40492d1cfb..ec001595f1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,7 +213,9 @@ jobs: if [ "$failedTests" -gt 0 ]; then if [ "$LAST_FAILED_RUN" == "1" ]; then 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 echo "Found failed tests, but LAST_FAILED_RUN is switched off. Running all tests." fi diff --git a/plugins/woocommerce/changelog/ci-dont-use-sharding-for-last-failed b/plugins/woocommerce/changelog/ci-dont-use-sharding-for-last-failed new file mode 100644 index 00000000000..53db001a0c0 --- /dev/null +++ b/plugins/woocommerce/changelog/ci-dont-use-sharding-for-last-failed @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +CI: Use a single shard when re-running failed tests in CI diff --git a/plugins/woocommerce/tests/e2e-pw/.gitignore b/plugins/woocommerce/tests/e2e-pw/.gitignore index 4bd09d22e03..6706d67ff2d 100644 --- a/plugins/woocommerce/tests/e2e-pw/.gitignore +++ b/plugins/woocommerce/tests/e2e-pw/.gitignore @@ -1,3 +1,4 @@ /.state /test-results /envs/_default +/playwright-report diff --git a/plugins/woocommerce/tests/e2e-pw/playwright.config.js b/plugins/woocommerce/tests/e2e-pw/playwright.config.js index 6b7691be2c3..4fbcbbbe682 100644 --- a/plugins/woocommerce/tests/e2e-pw/playwright.config.js +++ b/plugins/woocommerce/tests/e2e-pw/playwright.config.js @@ -15,7 +15,6 @@ const { CI, DEFAULT_TIMEOUT_OVERRIDE, E2E_MAX_FAILURES, - PLAYWRIGHT_HTML_REPORT, REPEAT_EACH, } = process.env; @@ -54,9 +53,7 @@ if ( process.env.CI ) { reporter.push( [ 'html', { - outputFolder: - PLAYWRIGHT_HTML_REPORT ?? - `${ testsResultsPath }/reports/playwright-report`, + outputFolder: `${ testsResultsPath }/playwright-report`, open: 'on-failure', }, ] );