Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Vite server for E2E tests in CI (Fix windows CI failures) #2584

Merged
merged 6 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"scripts": {
"start": "cross-env NODE_ENV=development concurrently \"npm:collab\" \"npm run dev --prefix packages/lexical-playground\"",
"start:website": "npm run start --prefix packages/lexical-website-new -- --port 3001",
"start:playground": "serve packages/lexical-playground/build -l 4000",
"start:playground": "npm run start-test-server",
"dev": "npm run dev --prefix packages/lexical-playground",
"start-test-server": "npm run preview --prefix packages/lexical-playground -- --port 4000",
"build": "node scripts/build.js",
"build-prod": "npm run clean && npm run build -- --prod",
"build-playground-prod": "npm run build-prod && npm run build-prod --prefix packages/lexical-playground",
Expand Down Expand Up @@ -44,14 +45,14 @@
"test-e2e-collab-webkit": "cross-env E2E_BROWSER=webkit E2E_EDITOR_MODE=rich-text-with-collab playwright test --project=\"webkit\"",
"test-e2e-prod-chromium": "cross-env E2E_BROWSER=chromium E2E_PORT=4000 playwright test --project=\"chromium\"",
"test-e2e-collab-prod-chromium": "cross-env E2E_BROWSER=chromium E2E_PORT=4000 E2E_EDITOR_MODE=rich-text-with-collab playwright test --project=\"chromium\"",
"test-e2e-ci-chromium": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e-chromium",
"test-e2e-ci-firefox": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e-firefox",
"test-e2e-ci-webkit": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e-webkit",
"test-e2e-collab-ci-chromium": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci-collab 4000 test-e2e-collab-chromium",
"test-e2e-collab-ci-firefox": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci-collab 4000 test-e2e-collab-firefox",
"test-e2e-collab-ci-webkit": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci-collab 4000 test-e2e-collab-webkit",
"test-e2e-prod-ci-chromium": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci-prod 4000 test-e2e-prod-chromium",
"test-e2e-collab-prod-ci-chromium": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci-collab-prod 4000 test-e2e-collab-prod-chromium",
"test-e2e-ci-chromium": "npm run prepare-ci && cross-env E2E_PORT=4000 npm run test-e2e-chromium",
"test-e2e-ci-firefox": "npm run prepare-ci && cross-env E2E_PORT=4000 npm run test-e2e-firefox",
"test-e2e-ci-webkit": "npm run prepare-ci && cross-env E2E_PORT=4000 npm run test-e2e-webkit",
"test-e2e-collab-ci-chromium": "npm run prepare-ci && cross-env E2E_PORT=4000 concurrently -k -s \"first\" \"npm run collab\" \"npm run test-e2e-collab-chromium\"",
"test-e2e-collab-ci-firefox": "npm run prepare-ci && cross-env E2E_PORT=4000 concurrently -k -s \"first\" \"npm run collab\" \"npm run test-e2e-collab-firefox\"",
"test-e2e-collab-ci-webkit": "npm run prepare-ci && cross-env E2E_PORT=4000 concurrently -k -s \"first\" \"npm run collab\" \"npm run test-e2e-collab-webkit\"",
"test-e2e-prod-ci-chromium": "npm run prepare-ci-prod && cross-env E2E_PORT=4000 npm run test-e2e-prod-chromium",
"test-e2e-collab-prod-ci-chromium": " npm run prepare-ci-prod && cross-env E2E_PORT=4000 concurrently -k -s \"first\" \"npm run collab\" \"npm run test-e2e-collab-prod-chromium\"",
"run-all": "npm-run-all debug-test-e2e-*",
"debug-test-e2e": "cross-env playwright test --debug",
"debug-test-e2e-chromium": "cross-env E2E_BROWSER=chromium playwright test --debug --project=\"chromium\"",
Expand Down Expand Up @@ -83,10 +84,8 @@
"prettier": "prettier --list-different .",
"ci-check": "npm-run-all --parallel tsc flow prettier lint",
"prettier:fix": "prettier --write .",
"prepare-ci": "npm run build-dev --prefix packages/lexical-playground && serve packages/lexical-playground/build -l 4000",
"prepare-ci-collab": "npm run build-dev --prefix packages/lexical-playground && concurrently \"npm run collab\" \"serve packages/lexical-playground/build -l 4000\"",
"prepare-ci-prod": "npm run build-playground-prod && serve packages/lexical-playground/build -l 4000",
"prepare-ci-collab-prod": "npm run build-playground-prod && concurrently \"npm run collab\" \"serve packages/lexical-playground/build -l 4000\"",
"prepare-ci": "npm run build-dev --prefix packages/lexical-playground",
"prepare-ci-prod": "npm run build-playground-prod",
"prepare-release": "npm run build-release && node ./scripts/npm/prepare-release.js",
"prepare": "husky install",
"prepare-www": "node scripts/www/rewriteImports.js",
Expand Down Expand Up @@ -150,8 +149,6 @@
"prettier-plugin-organize-attributes": "^0.0.5",
"react-test-renderer": "^17.0.2",
"rollup": "^2.75.5",
"serve": "^13.0.2",
"start-server-and-test": "^1.13.0",
"tmp": "^0.2.1",
"ts-jest": "^28.0.2",
"typescript": "^4.6.4",
Expand Down
8 changes: 8 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,13 @@ const config = {
//trace: 'retain-on-failure',
video: 'on-first-retry',
},
webServer: IS_CI
? {
command: 'npm run start-test-server',
port: 4000,
reuseExistingServer: true,
timeout: 120 * 1000,
}
: undefined,
};
module.exports = config;