Skip to content

Commit 2882e98

Browse files
authored
Migrate to plugin e2e tests (#514)
1 parent 8ce61c7 commit 2882e98

File tree

7 files changed

+18
-99
lines changed

7 files changed

+18
-99
lines changed

.github/workflows/e2e-tests.yml

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

.github/workflows/publish.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
environment: ${{ github.event.inputs.environment }}
3636
docs-only: ${{ fromJSON(github.event.inputs.docs-only) }}
3737
golangci-lint-version: '2.1.6'
38-
# the shared workflow doesn't have a mechanism to specify custom Vault secrets in e2e tests, so we're using the workflow in e2e-tests.yml instead
39-
run-playwright: false
38+
playwright-secrets: |
39+
ACCESS_KEY=e2e:accessKey
40+
SECRET_KEY=e2e:secretKey
4041
4142
# Scope for the plugin published to the catalog. Setting this to "grafana_cloud" will make it visible only in Grafana Cloud
4243
# (and hide it for on-prem). This is required for some provisioned plugins.

.github/workflows/push.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ jobs:
1818
with:
1919
plugin-version-suffix: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
2020
golangci-lint-version: '2.1.6'
21-
# the shared workflow doesn't have a mechanism to specify custom Vault secrets in e2e tests, so we're using the workflow in e2e-tests.yml instead
22-
run-playwright: false
21+
playwright-secrets: |
22+
ACCESS_KEY=e2e:accessKey
23+
SECRET_KEY=e2e:secretKey

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ provisioning/
5252
/blob-report/
5353
/playwright/.cache/
5454
/playwright/.auth/
55+
.env*
5556

5657
# OS
5758
*.DS_Store

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"copy-webpack-plugin": "^13.0.0",
6161
"cspell": "9.1.3",
6262
"css-loader": "^7.1.2",
63+
"dotenv": "^17.2.0",
6364
"eslint": "^9.31.0",
6465
"eslint-config-prettier": "^10.1.5",
6566
"eslint-plugin-deprecation": "^3.0.0",

playwright.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { dirname } from 'path';
22
import { defineConfig, devices } from '@playwright/test';
33
import type { PluginOptions } from '@grafana/plugin-e2e';
4+
import dotenv from 'dotenv';
5+
import path from 'path';
6+
7+
// Read from ".env" file.
8+
dotenv.config({ path: path.resolve(__dirname, '.env') });
49

510
const pluginE2eAuth = `${dirname(require.resolve('@grafana/plugin-e2e'))}/auth`;
611

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,6 +4085,11 @@ [email protected]:
40854085
optionalDependencies:
40864086
"@types/trusted-types" "^2.0.7"
40874087

4088+
dotenv@^17.2.0:
4089+
version "17.2.0"
4090+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-17.2.0.tgz#e19678fdabcf86d4bfdb6764a758d7d44efbb6a2"
4091+
integrity sha512-Q4sgBT60gzd0BB0lSyYD3xM4YxrXA9y4uBDof1JNYGzOXrQdQ6yX+7XIAqoFOGQFOTK1D3Hts5OllpxMDZFONQ==
4092+
40884093
downshift@^9.0.6:
40894094
version "9.0.8"
40904095
resolved "https://registry.yarnpkg.com/downshift/-/downshift-9.0.8.tgz#a7fea7c522e31d72ccee7947fa8069ec5e7c30fb"

0 commit comments

Comments
 (0)