From 178466aa06b13c6d93a1261e3551b18270d166d0 Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:38:49 +0100 Subject: [PATCH] [e2e tests] Tweak Playwright config - retries and test artifacts (#49148) --- .../e2e-tweak-pw-config-retries-and-artifacts | 4 +++ plugins/woocommerce/package.json | 30 +++++++++---------- .../tests/e2e-pw/playwright.config.js | 10 +++++-- 3 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 plugins/woocommerce/changelog/e2e-tweak-pw-config-retries-and-artifacts diff --git a/plugins/woocommerce/changelog/e2e-tweak-pw-config-retries-and-artifacts b/plugins/woocommerce/changelog/e2e-tweak-pw-config-retries-and-artifacts new file mode 100644 index 00000000000..4f73f5cc6c2 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-tweak-pw-config-retries-and-artifacts @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + + diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json index 9a34e02b6e6..830312e8f9b 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -236,11 +236,12 @@ "testType": "e2e", "command": "test:e2e:with-env default", "shardingArguments": [ - "--shard=1/5", - "--shard=2/5", - "--shard=3/5", - "--shard=4/5", - "--shard=5/5" + "--shard=1/6", + "--shard=2/6", + "--shard=3/6", + "--shard=4/6", + "--shard=5/6", + "--shard=6/6" ], "changes": [ "client/admin/config/*.json", @@ -574,16 +575,15 @@ "testType": "e2e", "command": "test:e2e:blocks", "shardingArguments": [ - "--shard=1/10", - "--shard=2/10", - "--shard=3/10", - "--shard=4/10", - "--shard=5/10", - "--shard=6/10", - "--shard=7/10", - "--shard=8/10", - "--shard=9/10", - "--shard=10/10" + "--shard=1/9", + "--shard=2/9", + "--shard=3/9", + "--shard=4/9", + "--shard=5/9", + "--shard=6/9", + "--shard=7/9", + "--shard=8/9", + "--shard=9/9" ], "changes": [ "src/Blocks/**", diff --git a/plugins/woocommerce/tests/e2e-pw/playwright.config.js b/plugins/woocommerce/tests/e2e-pw/playwright.config.js index 81b42d6120a..da24401e541 100644 --- a/plugins/woocommerce/tests/e2e-pw/playwright.config.js +++ b/plugins/woocommerce/tests/e2e-pw/playwright.config.js @@ -23,6 +23,12 @@ const reporter = [ `${ testsRootPath }/test-results/allure-results`, detail: true, suiteTitle: true, + environmentInfo: { + Node: process.version, + OS: process.platform, + WP: process.env.WP_VERSION, + CI: process.env.CI, + }, }, ], [ @@ -58,7 +64,7 @@ const config = { globalSetup: require.resolve( './global-setup' ), globalTeardown: require.resolve( './global-teardown' ), testDir: `${ testsRootPath }/tests`, - retries: CI ? 2 : 0, + retries: CI ? 1 : 0, repeatEach: REPEAT_EACH ? Number( REPEAT_EACH ) : 1, workers: 1, reportSlowTests: { max: 5, threshold: 30 * 1000 }, // 30 seconds threshold @@ -70,7 +76,7 @@ const config = { stateDir: `${ testsRootPath }/.state/`, trace: /^https?:\/\/localhost/.test( BASE_URL ) || ! CI - ? 'retain-on-failure' + ? 'retain-on-first-failure' : 'off', video: 'retain-on-failure', viewport: { width: 1280, height: 720 },