Skip to content

Commit cf882d8

Browse files
Plataneclaude
andcommitted
Migrate e2e tests from Cypress to Playwright
Replace deprecated @grafana/e2e (Cypress) with @grafana/plugin-e2e (Playwright). Remove Cypress config/tests, add Playwright config with auth project, smoke test, CI caching of node_modules, and Grafana version matrix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c99a033 commit cf882d8

File tree

10 files changed

+1126
-5488
lines changed

10 files changed

+1126
-5488
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
jobs:
1515
build:
1616
runs-on: ubuntu-latest
17+
outputs:
18+
e2e-matrix: ${{ steps.resolve-versions.outputs.matrix }}
1719
steps:
1820
- uses: actions/checkout@v6
1921
- name: Setup Node.js environment
@@ -22,6 +24,12 @@ jobs:
2224
node-version: '22'
2325
cache: 'npm'
2426

27+
- name: Cache node_modules for future jobs
28+
uses: actions/cache@v4
29+
with:
30+
path: node_modules
31+
key: node-modules-${{ hashFiles('package-lock.json') }}
32+
2533
- name: Install dependencies
2634
run: npm ci
2735

@@ -34,15 +42,6 @@ jobs:
3442
- name: Build frontend
3543
run: npm run build
3644

37-
- name: Start grafana docker
38-
run: docker compose up -d
39-
40-
- name: Run e2e tests
41-
run: npm run e2e
42-
43-
- name: Stop grafana docker
44-
run: docker compose down
45-
4645
- name: Check for backend
4746
id: check-for-backend
4847
run: |
@@ -70,3 +69,69 @@ jobs:
7069
with:
7170
version: latest
7271
args: buildAll
72+
73+
- name: Upload build artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: dist
77+
path: dist/
78+
79+
- name: Resolve Grafana E2E versions
80+
id: resolve-versions
81+
uses: grafana/plugin-actions/e2e-version@e2e-version/v1.2.1
82+
with:
83+
skip-grafana-react-19-preview-image: false
84+
85+
e2e:
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 15
88+
needs: build
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
GRAFANA_IMAGE: ${{ fromJson(needs.build.outputs.e2e-matrix) }}
93+
QUICKWIT_VERSION: [edge]
94+
steps:
95+
- uses: actions/checkout@v6
96+
97+
- name: Download build artifact
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: dist
101+
path: dist/
102+
103+
- name: Restore executable permissions
104+
run: chmod +x dist/gpx_quickwit_*
105+
106+
- name: Setup Node.js environment
107+
uses: actions/setup-node@v6
108+
with:
109+
node-version: '22'
110+
111+
- name: Restore node_modules
112+
uses: actions/cache/restore@v4
113+
with:
114+
path: node_modules
115+
key: node-modules-${{ hashFiles('package-lock.json') }}
116+
117+
- name: Install Playwright
118+
run: npx playwright install --with-deps chromium
119+
120+
- name: Start Grafana (${{ matrix.GRAFANA_IMAGE.name }}:${{ matrix.GRAFANA_IMAGE.version }}) + Quickwit (${{ matrix.QUICKWIT_VERSION }})
121+
run: docker compose up -d --build
122+
env:
123+
GRAFANA_VERSION: ${{ matrix.GRAFANA_IMAGE.version }}
124+
GRAFANA_IMAGE: ${{ matrix.GRAFANA_IMAGE.name }}
125+
QUICKWIT_VERSION: ${{ matrix.QUICKWIT_VERSION }}
126+
127+
- name: Wait for Grafana and Quickwit to start
128+
run: |
129+
timeout 60 bash -c 'until curl -sf http://localhost:3000/api/health; do sleep 2; done' || { docker compose logs grafana; exit 1; }
130+
timeout 60 bash -c 'until curl -sf http://localhost:7280/health/readyz; do sleep 2; done' || { docker compose logs quickwit; exit 1; }
131+
132+
- name: Run e2e tests
133+
run: npm run e2e
134+
135+
- name: Stop Grafana
136+
if: always()
137+
run: docker compose down

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ artifacts/
3131
work/
3232
ci/
3333
e2e-results/
34-
**/cypress/videos
35-
**/cypress/report.json
34+
playwright-report/
35+
test-results/
36+
playwright/.auth/
3637

3738
# Editor
3839
.idea

QA_CHECKLIST.md

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

cypress.json

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

cypress/integration/01-smoke.spec.ts

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

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.0'
22

33
services:
44
quickwit:
5-
image: quickwit/quickwit:edge
5+
image: quickwit/quickwit:${QUICKWIT_VERSION:-edge}
66
environment:
77
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:7281
88
- QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER=true
@@ -16,7 +16,7 @@ services:
1616
build:
1717
context: ./.config
1818
args:
19-
grafana_version: ${GRAFANA_VERSION:-12.1.0}
19+
grafana_version: ${GRAFANA_VERSION:-12.4.0}
2020
grafana_image: ${GRAFANA_IMAGE:-grafana-oss}
2121
ports:
2222
- 3000:3000/tcp

0 commit comments

Comments
 (0)