Skip to content

Commit b143a65

Browse files
committed
test(e2e): add a playwright-utils UI test package with a non-blocking CI job
- e2e/: isolated pnpm package (outside the workspace) on @anaconda/playwright-utils; the private package is read with a token passed as NODE_AUTH_TOKEN, never stored in the repo - migrate the get-started and app-shell accessibility specs (4 tests) and remove their legacy copies; the other legacy specs keep running from apps/web/tests/e2e - .github/workflows/e2e.yml: Postgres, migrations, next dev with fake login, route warm-up, tests; not a required check, fork PRs skipped, token scoped to the install step - CODEOWNERS for e2e/; root oxlint/oxfmt/prettier skip e2e/
1 parent 10e1679 commit b143a65

31 files changed

Lines changed: 4434 additions & 156 deletions

‎.github/CODEOWNERS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# QA reviews every change to the isolated UI test package.
2+
/e2e/ @yz-anaconda

‎.github/workflows/e2e.yml‎

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: E2E (playwright-utils)
2+
3+
# UI tests in e2e/, built on the private @anaconda/playwright-utils package.
4+
# Not a required check: a failure is reported on the PR but never blocks a merge.
5+
6+
on:
7+
pull_request:
8+
merge_group:
9+
workflow_dispatch:
10+
push:
11+
# Temporary: lets the pipeline run from the working branch before a PR exists.
12+
branches: [e2e/legacy-tests-on-playwright-utils]
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
e2e:
23+
# Fork PRs get no secrets, so the private package can't be installed; skip instead of failing.
24+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 45
27+
28+
services:
29+
postgres:
30+
image: pgvector/pgvector:pg16
31+
env:
32+
POSTGRES_HOST_AUTH_METHOD: trust
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
ports:
39+
- 5432:5432
40+
41+
env:
42+
POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/postgres
43+
POSTGRES_CONNECT_TIMEOUT: 30000
44+
POSTGRES_MAX_QUERY_TIME: 30000
45+
46+
steps:
47+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48+
with:
49+
# Nothing here pushes; don't leave the job's GITHUB_TOKEN in .git/config for later steps.
50+
persist-credentials: false
51+
52+
- name: Setup pnpm
53+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
54+
55+
- name: Setup Node.js
56+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
57+
with:
58+
node-version-file: '.nvmrc'
59+
cache: 'pnpm'
60+
cache-dependency-path: |
61+
pnpm-lock.yaml
62+
e2e/pnpm-lock.yaml
63+
64+
- name: Install app dependencies
65+
run: pnpm install --frozen-lockfile
66+
67+
- name: Install e2e dependencies
68+
working-directory: e2e
69+
# The token is scoped to this step only; the app and the tests never see it.
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.ANACONDA_PACKAGES_READ_TOKEN }}
72+
run: pnpm install --frozen-lockfile --ignore-workspace --ignore-scripts
73+
74+
- name: Run database migrations
75+
run: pnpm drizzle migrate
76+
77+
- name: Cache Playwright browsers
78+
id: playwright-cache
79+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
80+
with:
81+
path: ~/.cache/ms-playwright
82+
key: playwright-${{ runner.os }}-${{ hashFiles('e2e/pnpm-lock.yaml') }}
83+
84+
- name: Install Playwright browser
85+
if: steps.playwright-cache.outputs.cache-hit != 'true'
86+
working-directory: e2e
87+
run: pnpm exec playwright install --with-deps chromium
88+
89+
- name: Install Playwright system dependencies
90+
if: steps.playwright-cache.outputs.cache-hit == 'true'
91+
working-directory: e2e
92+
run: pnpm exec playwright install-deps chromium
93+
94+
- name: Start web app
95+
run: nohup node e2e/ci/start-web.mjs > web-server.log 2>&1 &
96+
97+
- name: Warm up routes
98+
run: node e2e/ci/warm-up.mjs
99+
100+
- name: Run tests
101+
working-directory: e2e
102+
run: pnpm test
103+
104+
- name: Upload report
105+
if: always()
106+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
107+
with:
108+
name: e2e-report
109+
path: |
110+
e2e/playwright-report
111+
e2e/test-results
112+
web-server.log
113+
retention-days: 7

‎.oxfmtrc.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"arrowParens": "avoid",
1010
"endOfLine": "lf",
1111
"sortPackageJson": false,
12-
"ignorePatterns": ["services/kilo-mcp/catalog.json"]
12+
"ignorePatterns": ["services/kilo-mcp/catalog.json", "e2e/**"]
1313
}

‎.oxlintrc.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"ignorePatterns": [
1515
".next/**",
16+
"e2e/**",
1617
"node_modules/**",
1718
"**/node_modules/**",
1819
"**/*.js",

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ pnpm-lock.yaml
4747
!.env.example
4848
*.sql
4949

50+
# Isolated QA package with its own Prettier config (see e2e/README.md)
51+
e2e/

‎apps/web/tests/e2e/app-shell-accessibility.spec.ts‎

Lines changed: 0 additions & 108 deletions
This file was deleted.

‎apps/web/tests/e2e/get-started-dashboard-link.spec.ts‎

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎e2e/.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
test-results/
3+
playwright-report/
4+
.env

‎e2e/.npmrc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@anaconda:registry=https://npm.pkg.github.com
2+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

‎e2e/.prettierrc‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": true,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"quoteProps": "as-needed",
7+
"printWidth": 120,
8+
"tabWidth": 2,
9+
"bracketSpacing": true,
10+
"arrowParens": "avoid",
11+
"endOfLine": "lf",
12+
"overrides": [
13+
{
14+
"files": ["*.json"],
15+
"options": {
16+
"trailingComma": "none"
17+
}
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)