Skip to content

Commit

Permalink
use env var to select config
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanHoladay committed Nov 1, 2024
1 parent f917d8f commit c3b2f51
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 78 deletions.
8 changes: 4 additions & 4 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:local-auth": "playwright test tests/local-auth.spec.ts --config=playwright.config.local-auth.ts",
"test:reconnect": "playwright test tests/reconnect.spec.ts --config=playwright.reconnect.config.ts",
"test:e2e": "playwright test",
"test:e2e-in-cluster": "playwright test --config=playwright.config.in-cluster.ts",
"test:local-auth": "TEST_CFG=localAuth playwright test tests/local-auth.spec.ts",
"test:reconnect": "TEST_CFG=reconnect playwright test",
"test:e2e": "TEST_CFG=default playwright test",
"test:e2e-in-cluster": "TEST_CFG=inCluster playwright test",
"test:install": "playwright install",
"test:unit": "vitest run"
},
Expand Down
21 changes: 0 additions & 21 deletions ui/playwright.config.in-cluster.ts

This file was deleted.

21 changes: 0 additions & 21 deletions ui/playwright.config.local-auth.ts

This file was deleted.

10 changes: 9 additions & 1 deletion ui/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { defineConfig } from '@playwright/test'
import { loadEnv } from 'vite'

const { VITE_PORT_ENV } = loadEnv('dev', process.cwd())
const TEST_CONFIG = process.env.TEST_CFG || 'default'

// use port 8443 because by default we use TLS when running locally
const port = VITE_PORT_ENV ?? '8443'
Expand Down Expand Up @@ -73,6 +74,13 @@ const reconnect = {
},
}

export default defineConfig({ projects: [defaultConfig, localAuth, inCluster, reconnect] })
const configs = {
default: defaultConfig,
localAuth,
inCluster,
reconnect,
}

export default defineConfig({ ...configs[TEST_CONFIG] })

export { port }
31 changes: 0 additions & 31 deletions ui/playwright.reconnect.config.ts

This file was deleted.

0 comments on commit c3b2f51

Please sign in to comment.