Skip to content

Commit

Permalink
E2e tests for apps examples (#321)
Browse files Browse the repository at this point in the history
* add tests configs to all the apps

* e2e tests for app-with-rbac and app-with-service-account

* fix build

* add feature toggle service account into CI

* testing

* testing

* testing

* fixes for app-with-service-account

* WIP

* update plugin-e2e to 1.6.0

* add .env file to app-with-rbac

* bump version of plugin-e2e to 1.6.0 for all the plugins

* update package.lock.json files

* remove plugin-meta-exatractor from app-with-rbac
  • Loading branch information
Ukochka authored Jun 25, 2024
1 parent eec8946 commit 815d34f
Show file tree
Hide file tree
Showing 56 changed files with 24,983 additions and 34,243 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ jobs:
echo "CANARY_VERSION=${{ needs.setup-matrix.outputs.canaryVersion }}" >> $GITHUB_ENV
echo "CANARY_DOCKER_TAG=${{ needs.setup-matrix.outputs.canaryDockerTag }}" >> $GITHUB_ENV
echo "LATEST_STABLE_VERSION=${{ needs.setup-matrix.outputs.latestVersion }}" >> $GITHUB_ENV
if [ -f "${PWD}/.env" ]; then
echo "ENV_FILE_OPTION=--env-file ${PWD}/.env" >> $GITHUB_ENV
fi
working-directory: ${{ matrix.pluginDir }}

- name: Has Integration Tests
Expand Down Expand Up @@ -163,7 +166,7 @@ jobs:
- name: Expected version - Start Grafana
if: steps.has-integration-tests.outputs.DIR == 'true' && steps.should-run-expected-latest-tests.outcome == 'success'
run: |
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED grafana/grafana:$EXPECTED_GRAFANA_VERSION
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED $ENV_FILE_OPTION grafana/grafana:$EXPECTED_GRAFANA_VERSION
working-directory: ${{ matrix.pluginDir }}

- name: Expected - Wait for Grafana to start
Expand Down Expand Up @@ -204,7 +207,7 @@ jobs:
- name: Latest - Start Grafana
if: steps.has-integration-tests.outputs.DIR == 'true' && steps.should-run-expected-latest-tests.outcome == 'success'
run: |
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED grafana/grafana:latest
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED $ENV_FILE_OPTION grafana/grafana:latest
working-directory: ${{ matrix.pluginDir }}

- name: Latest - Wait for Grafana to start
Expand Down Expand Up @@ -270,7 +273,7 @@ jobs:
- name: Canary - Start Grafana dev image
if: steps.has-integration-tests.outputs.DIR == 'true'
run: |
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED grafana/grafana-dev:$CANARY_DOCKER_TAG
docker run -d -p 3000:3000 --add-host=host.docker.internal:host-gateway --name $PLUGIN_ID -v ${PWD}/dist:/var/lib/grafana/plugins/$PLUGIN_ID -v ${PWD}/provisioning:/etc/grafana/provisioning -e GF_DEFAULT_APP_MODE -e GF_INSTALL_PLUGINS -e GF_AUTH_ANONYMOUS_ORG_ROLE -e GF_AUTH_ANONYMOUS_ENABLED -e GF_AUTH_BASIC_ENABLED $ENV_FILE_OPTION grafana/grafana-dev:$CANARY_DOCKER_TAG
working-directory: ${{ matrix.pluginDir }}

- name: Canary - Wait for Grafana to start
Expand Down
8 changes: 4 additions & 4 deletions examples/app-basic/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/app-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.2",
"@grafana/plugin-e2e": "^1.6.0",
"@grafana/plugin-meta-extractor": "^0.0.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "^1.41.2",
Expand Down
8 changes: 4 additions & 4 deletions examples/app-with-backend/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/app-with-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.2",
"@grafana/plugin-e2e": "^1.6.0",
"@grafana/plugin-meta-extractor": "^0.0.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "^1.42.1",
Expand Down
8 changes: 4 additions & 4 deletions examples/app-with-dashboards/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/app-with-dashboards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.2",
"@grafana/plugin-e2e": "^1.6.0",
"@grafana/plugin-meta-extractor": "^0.0.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "^1.43.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/app-with-extension-point/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/app-with-extension-point/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.2",
"@grafana/plugin-e2e": "^1.6.0",
"@grafana/plugin-meta-extractor": "^0.0.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "^1.43.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/app-with-extensions/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/app-with-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/plugin-e2e": "^1.2.2",
"@grafana/plugin-e2e": "^1.6.0",
"@grafana/plugin-meta-extractor": "^0.0.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "^1.43.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/app-with-rbac/.config/.cprc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "4.10.4"
"version": "4.11.0"
}
2 changes: 0 additions & 2 deletions examples/app-with-rbac/.config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import LiveReloadPlugin from 'webpack-livereload-plugin';
import path from 'path';
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
import { Configuration } from 'webpack';
import { GrafanaPluginMetaExtractor } from '@grafana/plugin-meta-extractor';

import { getPackageJson, getPluginJson, hasReadme, getEntries, isWSL } from './utils';
import { SOURCE_DIR, DIST_DIR } from './constants';
Expand Down Expand Up @@ -141,7 +140,6 @@ const config = async (env): Promise<Configuration> => {
},

plugins: [
new GrafanaPluginMetaExtractor(),
new CopyWebpackPlugin({
patterns: [
// If src/README.md exists use it; otherwise the root README
Expand Down
1 change: 1 addition & 0 deletions examples/app-with-rbac/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall,idForwarding,externalServiceAccounts
Loading

0 comments on commit 815d34f

Please sign in to comment.