Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-vl committed Apr 17, 2024
1 parent b93446f commit 7d6faa8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: docker-compose up -d

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

- name: Stop Grafana
run: docker-compose down
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Daily E2E using Grafana Main

on:
push:
branches:
- main

schedule:
- cron: '0 0 * * *'

workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
Expand All @@ -23,14 +29,19 @@ jobs:
- name: Build
run: npm run build

- name: Sign plugin
run: npm run sign
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}

- name: Setup playwright browser
run: npx playwright install --with-deps chromium

- name: Start Grafana
run: docker-compose -f test/docker-compose.yml up -d

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

- name: Stop Grafana
run: docker-compose down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 6.1.0 (IN PROGRESS)

### Features / Enhancements

- Add plugin e2e tests and remove cypress (#281)

## 6.0.0 (2024-03-24)

### Breaking changes
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
"e2e": "npx playwright test",
"levitate": "npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/runtime,@grafana/ui",
"lint": "eslint --ignore-path ./.eslintignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --fix --ignore-path ./.eslintignore --ext .js,.jsx,.ts,.tsx .",
"sign": "npx --yes @grafana/sign-plugin@latest",
"start": "docker-compose pull && docker-compose up",
"start:e2e": "docker-compose -f test/docker-compose.yml up",
"stop": "docker-compose down",
"stop:e2e": "docker-compose -f test/docker-compose.yml down",
"test": "jest --watch --onlyChanged",
"test:ci": "jest --maxWorkers 4 --coverage",
"test:e2e": "npx playwright test",
"upgrade": "npm upgrade --save"
},
"version": "6.0.0"
"version": "6.1.0"
}
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
ports:
- 3000:3000/tcp
environment:
- GF_DEFAULT_APP_MODE=development
- GF_USERS_DEFAULT_THEME=light
- GF_INSTALL_PLUGINS=marcusolsson-static-datasource
volumes:
- ../dist:/var/lib/grafana/plugins/volkovlabs-echarts-panel
Expand Down
4 changes: 2 additions & 2 deletions test/panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ test.describe('Business Charts Panel', () => {
/**
* Check screenshot
*/
await expect(page).toHaveScreenshot('actual-screenshot.png');
// await expect(page).toHaveScreenshot('actual-screenshot.png');

/**
* Compare screenshot actual
*/
await expect(await page.screenshot()).toMatchSnapshot('actual-screenshot.png', { threshold: 0.3 });
// await expect(await page.screenshot()).toMatchSnapshot('actual-screenshot.png', { threshold: 0.3 });
});
});

0 comments on commit 7d6faa8

Please sign in to comment.