Skip to content

Commit

Permalink
Update E2E tests (#377)
Browse files Browse the repository at this point in the history
* dev dep added

* e2e updates

* lint fixes

* Update CHANGELOG.md

---------

Co-authored-by: Mikhail Volkov <mikhail@volkovlabs.io>
  • Loading branch information
vitPinchuk and mikhail-vl authored Dec 9, 2024
1 parent dff728f commit 061a1ac
Show file tree
Hide file tree
Showing 12 changed files with 780 additions and 40 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

jobs:
tests:
dev:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -42,3 +42,37 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

dependency:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Start Grafana
run: docker compose --profile dependency up -d

- name: Run e2e tests
run: npm run test:e2e:docker

- name: Stop Grafana
run: docker compose down

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-dependency
path: playwright-report/
retention-days: 30
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Updated Autosize Code Editor toolbar (#362)
- Added helper statusColor from specific field (#375)
- Updated E2E tests (#377)

## 5.4.0 (2024-09-12)

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ services:
profiles:
- main

grafana-dep:
image: grafana/grafana:10.0.0
ports:
- 3000:3000/tcp
environment:
- GF_DEFAULT_APP_MODE=development
- GF_USERS_DEFAULT_THEME=light
- GF_INSTALL_PLUGINS=volkovlabs-rss-datasource,marcusolsson-static-datasource,yesoreyeram-infinity-datasource
volumes:
- ./dist:/var/lib/grafana/plugins/marcusolsson-dynamictext-panel
- ./provisioning:/etc/grafana/provisioning
profiles:
- dependency

test:
build:
context: .
Expand Down
51 changes: 45 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.8.0",
"@grafana/plugin-e2e": "^1.12.3",
"@grafana/tsconfig": "^2.0.0",
"@playwright/test": "^1.47.0",
"@swc/core": "^1.7.26",
Expand Down Expand Up @@ -76,10 +76,12 @@
"sign": "npx --yes @grafana/sign-plugin@latest",
"start": "docker compose pull grafana && docker compose --profile dev up",
"start:main": "docker compose pull grafana-main && docker compose --profile main up",
"start:dep": "docker compose pull grafana-dep && docker compose --profile dependency up",
"stop": "docker compose down",
"test": "jest --watch --onlyChanged",
"test:ci": "jest --maxWorkers 4 --coverage",
"test:e2e": "npx playwright test",
"test:e2e:dev": "npx playwright test --ui",
"test:e2e:docker": "docker compose --profile e2e up --exit-code-from test",
"upgrade": "npm upgrade --save"
},
Expand Down
Loading

0 comments on commit 061a1ac

Please sign in to comment.