ci: start devServer before test running to avoid tests timeout (#11297)

This commit is contained in:
Brooooooklyn
2025-03-31 10:39:34 +00:00
parent eda680ccdc
commit 47a8d15878
10 changed files with 117 additions and 73 deletions

View File

@@ -3,7 +3,6 @@ import type {
PlaywrightTestConfig,
PlaywrightWorkerOptions,
} from '@playwright/test';
// import { devices } from '@playwright/test';
/**
* Read environment variables from file.
@@ -19,6 +18,7 @@ const config: PlaywrightTestConfig = {
fullyParallel: true,
timeout: process.env.CI ? 50_000 : 30_000,
outputDir: testResultDir,
globalSetup: './dev-server.ts',
use: {
baseURL: 'http://localhost:8080/',
browserName:
@@ -42,19 +42,6 @@ const config: PlaywrightTestConfig = {
// default 'list' when running locally
// See https://playwright.dev/docs/test-reporters#github-actions-annotations
reporter: process.env.CI ? 'github' : 'list',
webServer: [
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn run -T affine dev -p @affine/web',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
},
},
],
};
if (process.env.CI) {