-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Playwright and k6 E2E tests for comparison (#637)
* WIP: E2E comparison * WIP: E2E comparison * Test e2e image for cypress * Use known good version * Add nvm init command * Set user * Login shell * Copy init file instead * Readd user * Use runner user * Fix git issue with dir owner * Test with package updates * Add Playwright and k6 * Fix cspell error --------- Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
- Loading branch information
Showing
11 changed files
with
828 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: E2E tests - k6 | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Install Mage | ||
uses: magefile/mage-action@v3 | ||
with: | ||
install-only: true | ||
|
||
- name: Install yarn dependencies | ||
run: yarn install | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
|
||
- name: Build binaries | ||
run: mage -v | ||
|
||
- name: Build frontend | ||
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/dist:/var/lib/grafana/plugins/azure-data-explorer-datasource" grafana/grafana; sleep 30 | ||
|
||
- name: Run E2E tests | ||
run: k6 run ./e2e/k6/k6.spec.js | ||
env: | ||
E2E_ADX_CLIENT_ID: ${{ secrets.E2E_ADX_CLIENT_ID }} | ||
E2E_ADX_CLIENT_SECRET: ${{ secrets.E2E_ADX_CLIENT_SECRET }} | ||
E2E_ADX_CLUSTER_URL: ${{ secrets.E2E_ADX_CLUSTER_URL }} | ||
E2E_ADX_TENANT_ID: ${{ secrets.E2E_ADX_TENANT_ID }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: E2E tests - Playwright | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Install Mage | ||
uses: magefile/mage-action@v3 | ||
with: | ||
install-only: true | ||
|
||
- name: Install yarn dependencies | ||
run: yarn install | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
|
||
- name: Build binaries | ||
run: mage -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/dist:/var/lib/grafana/plugins/grafana-azure-data-explorer-datasource" grafana/grafana; sleep 30 | ||
|
||
- name: Run Playwright tests | ||
run: yarn playwright test | ||
env: | ||
E2E_ADX_CLIENT_ID: ${{ secrets.E2E_ADX_CLIENT_ID }} | ||
E2E_ADX_CLIENT_SECRET: ${{ secrets.E2E_ADX_CLIENT_SECRET }} | ||
E2E_ADX_CLUSTER_URL: ${{ secrets.E2E_ADX_CLUSTER_URL }} | ||
E2E_ADX_TENANT_ID: ${{ secrets.E2E_ADX_TENANT_ID }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ yarn.lock | |
.idea | ||
pkg/__debug_bin | ||
provisioning | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ |
Oops, something went wrong.