Skip to content

Commit

Permalink
Use Vite server for E2E tests in CI (Fix windows CI failures) (#2584)
Browse files Browse the repository at this point in the history
* Use Vite dev server for E2E tests in CI

* use webServer

* whoops

* use static file server

* remove unused dependencies

* fix prod commands
  • Loading branch information
acywatson authored Jul 3, 2022
1 parent 5dfedbc commit 8ff62cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
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;

2 comments on commit 8ff62cf

@vercel
Copy link

@vercel vercel bot commented on 8ff62cf Jul 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website-new

lexical-fbopensource.vercel.app
lexical-git-main-fbopensource.vercel.app
lexical.dev
lexicaljs.com
lexicaljs.org
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 8ff62cf Jul 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground.vercel.app
lexical-playground-fbopensource.vercel.app
playground.lexical.dev
lexical-playground-git-main-fbopensource.vercel.app

Please sign in to comment.