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
This commit is contained in:
Zeke Zhang 2024-05-09 16:12:34 +08:00 committed by GitHub
parent 893f27fead
commit b54de2419d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -90,4 +90,4 @@ jobs:
DB_PASSWORD: password DB_PASSWORD: password
DB_DATABASE: nocobase DB_DATABASE: nocobase
APPEND_PRESET_LOCAL_PLUGINS: ${{ steps.vars.outputs.var2 }} APPEND_PRESET_LOCAL_PLUGINS: ${{ steps.vars.outputs.var2 }}
timeout-minutes: 240 timeout-minutes: 180

View File

@ -11,7 +11,7 @@ import { devices, defineConfig as playwrightDefineConfig, type PlaywrightTestCon
export const defineConfig = (config?: PlaywrightTestConfig) => { export const defineConfig = (config?: PlaywrightTestConfig) => {
return playwrightDefineConfig({ return playwrightDefineConfig({
timeout: 5 * 60 * 1000, timeout: process.env.CI ? 60 * 1000 : 30 * 1000,
expect: { expect: {
timeout: 10 * 1000, 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. // Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI, forbidOnly: !!process.env.CI,
retries: 2, retries: process.env.CI ? 2 : 0,
// Opt out of parallel tests on CI. // Opt out of parallel tests on CI.
// workers: process.env.CI ? 1 : undefined, // 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('/')`. // Base URL to use in actions like `await page.goto('/')`.
baseURL: process.env.APP_BASE_URL || `http://localhost:${process.env.APP_PORT || 20000}`, baseURL: process.env.APP_BASE_URL || `http://localhost:${process.env.APP_PORT || 20000}`,
// Collect trace when retrying the failed test.
trace: 'on-first-retry', trace: 'on-first-retry',
}, },
// Configure projects for major browsers. // Configure projects for major browsers.