Skip to content

Commit

Permalink
WIP: E2E comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyeats committed Oct 3, 2023
1 parent a35e52c commit 108e032
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 31 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: E2E tests - Cypress
on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install yarn dependencies
run: yarn install
env:
Expand All @@ -22,5 +24,9 @@ jobs:
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Start Grafana
run: docker run --rm -d -p 3000:3000 --name=grafana --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-azure-data-explorer-datasource --volume "$PWD:/var/lib/grafana/plugins" grafana/grafana

- name: Run E2E tests
run: yarn run e2e
9 changes: 7 additions & 2 deletions .github/workflows/k6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: E2E tests - k6
on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install yarn dependencies
run: yarn install
env:
Expand All @@ -22,14 +24,17 @@ jobs:
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Setup k6
run: |
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
- name: Start Grafana
run: docker run --rm -d -p 3000:3000 --name=grafana --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-azure-data-explorer-datasource --volume "$PWD:/var/lib/grafana/plugins" grafana/grafana
- name: Run e2e tests

- name: Run E2E tests
run: k6 run ./e2e/k6/k6.test.js
50 changes: 28 additions & 22 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,34 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...

- name: Build Frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Start Grafana
run: docker run --rm -d -p 3000:3000 --name=grafana --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-azure-data-explorer-datasource --volume "$PWD:/var/lib/grafana/plugins" grafana/grafana
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...

- name: Build Frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Start Grafana
run: docker run --rm -d -p 3000:3000 --name=grafana --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-azure-data-explorer-datasource --volume "$PWD:/var/lib/grafana/plugins" grafana/grafana

- name: Run Playwright tests
run: yarn playwright test

# - uses: actions/upload-artifact@v3
# if: always()
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull-request-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
with:
issue-number: ${{ github.event.number }}
body-includes: Use the following command to run this PR with Docker

- name: Update comment on PR
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v3
Expand All @@ -118,6 +119,7 @@ jobs:
```
docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
```
- name: Add comment to PR
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v3
Expand Down
1 change: 1 addition & 0 deletions e2e/playwright/playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ test('Configure panel', async ({ page }) => {
// run query
const runQueryBtn = page.locator(`[data-testid="data-testid run-query"]`);
await runQueryBtn.click();

// are there results?
const columns = page.locator(`[aria-label="Columns"]`);
await columns.click();
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,5 @@
"resolutions": {
"**/@testing-library/dom": "7.31.2"
},
"packageManager": "yarn@1.22.19",
"volta": {
"node": "18.18.0",
"yarn": "1.22.19"
}
"packageManager": "yarn@1.22.19"
}

0 comments on commit 108e032

Please sign in to comment.