From b54de2419d9132325c427a21d97ab3666998a7a4 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 9 May 2024 16:12:34 +0800 Subject: [PATCH] chore: optimize timeout for e2e (#4276) * chore: reduce timeout-minutes to 180 * chore: optimize timeout value in defineConfig * chore: optimize * chore: update retries and trace in defineConfig function * chore: update retries and trace options in defineConfig function --- .github/workflows/nocobase-test-e2e.yml | 2 +- packages/core/test/src/e2e/defineConfig.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nocobase-test-e2e.yml b/.github/workflows/nocobase-test-e2e.yml index 96f166406e..93fa629a5a 100644 --- a/.github/workflows/nocobase-test-e2e.yml +++ b/.github/workflows/nocobase-test-e2e.yml @@ -90,4 +90,4 @@ jobs: DB_PASSWORD: password DB_DATABASE: nocobase APPEND_PRESET_LOCAL_PLUGINS: ${{ steps.vars.outputs.var2 }} - timeout-minutes: 240 + timeout-minutes: 180 diff --git a/packages/core/test/src/e2e/defineConfig.ts b/packages/core/test/src/e2e/defineConfig.ts index c7943c2a35..547b002d4f 100644 --- a/packages/core/test/src/e2e/defineConfig.ts +++ b/packages/core/test/src/e2e/defineConfig.ts @@ -11,7 +11,7 @@ import { devices, defineConfig as playwrightDefineConfig, type PlaywrightTestCon export const defineConfig = (config?: PlaywrightTestConfig) => { return playwrightDefineConfig({ - timeout: 5 * 60 * 1000, + timeout: process.env.CI ? 60 * 1000 : 30 * 1000, expect: { timeout: 10 * 1000, @@ -29,7 +29,7 @@ export const defineConfig = (config?: PlaywrightTestConfig) => { // Fail the build on CI if you accidentally left test.only in the source code. forbidOnly: !!process.env.CI, - retries: 2, + retries: process.env.CI ? 2 : 0, // Opt out of parallel tests on CI. // workers: process.env.CI ? 1 : undefined, @@ -48,7 +48,6 @@ export const defineConfig = (config?: PlaywrightTestConfig) => { // Base URL to use in actions like `await page.goto('/')`. baseURL: process.env.APP_BASE_URL || `http://localhost:${process.env.APP_PORT || 20000}`, - // Collect trace when retrying the failed test. trace: 'on-first-retry', }, // Configure projects for major browsers.