Skip to content

Commit

Permalink
👷‍♂️ Be able to run ci related instances in parallel to dev instances…
Browse files Browse the repository at this point in the history
…. These should run on ##1# port. Add to playwright config #8
  • Loading branch information
D1no committed Apr 12, 2023
1 parent dd12f38 commit b22834a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions features/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { defineConfig, devices } from "@playwright/test";
*/
// require('dotenv').config();

const CI_BROWSER_URL = "http://127.0.0.1:3010";

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand All @@ -24,7 +26,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://127.0.0.1:3000",
baseURL: CI_BROWSER_URL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
Expand Down Expand Up @@ -70,8 +72,8 @@ export default defineConfig({

// Run your local dev server before starting the tests */
webServer: {
command: "cd ../platform && pnpm run start:browser",
url: "http://127.0.0.1:3000",
command: "cd ../platform && pnpm run start:browser:ci",
url: CI_BROWSER_URL,
reuseExistingServer: !process.env.CI,
},
});
1 change: 1 addition & 0 deletions platform/_tooling/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"scripts": {
"build-storybook": "storybook build",
"dev": "kill -15 $(lsof -ti:6006) || true && clear && storybook dev --ci --quiet -p 6006 ",
"dev:ci": "kill -15 $(lsof -ti:6016) || true && clear && storybook dev --ci --quiet -p 6016 ",
"storybook": "kill -15 $(lsof -ti:6006) || true && clear && storybook dev -p 6006",
"storybook:update": "pnpx storybook@next upgrade --skip-check"
},
Expand Down
3 changes: 2 additions & 1 deletion platform/apps/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"type": "module",
"scripts": {
"build": "tsc && vite build",
"dev": "kill -15 $(lsof -ti:3000) || true && vite --host --port 3000",
"dev": "kill -15 $(lsof -ti:3000) || true && vite --host --strictPort --port 3000",
"dev:ci": "kill -15 $(lsof -ti:3010) || true && vite --host --strictPort --port 3010",
"preview": "vite preview"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"prepare": "cd .. && husky install platform/_tooling/.husky",
"start": "pnpm --parallel --stream --if-present -r run dev",
"start:browser": "pnpm --filter @apps/browser run dev",
"start:browser:ci": "pnpm --filter @apps/browser run dev:ci",
"start:storybook": "pnpm --filter @tooling/storybook run dev",
"start:storybook:ci": "pnpm --filter @tooling/storybook run dev:ci",
"sys:clear-ports": "kill -15 $(lsof -ti:3000,6006)",
"sys:node_modules:calc": "find ../. -name 'node_modules' -type d -prune | xargs du -chs",
"sys:node_modules:delete": "find ../. -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
Expand Down

0 comments on commit b22834a

Please sign in to comment.