Skip to content

Commit d8ec95e

Browse files
sunkerjackw
andauthored
E2E: Add support for building test plugins (grafana#91873)
* build test apps with webpack * add extensions test app * update e2e tests * remove non-build test apps using amd * use @grafana/plugin-configs rather than create-plugin config * Update e2e/plugin-e2e/plugin-e2e-api-tests/as-admin-user/extensions/usePluginComponents.spec.ts Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> * Update package.json Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> * use run dir variable instead of hardcoded path * add dummy licence file * add separate step for building test plugins * support nested plugins * remove react-router-dom from the externals array * remove add_mode dev * lint starlark * pass license path as env variable * fix the path * chore(e2e-plugins): clean up dependencies to match core versions * refactor(e2e-plugins): prefer extending webpack plugins-config * docs(e2e-plugins): add basic info to extensions test plugin readme * update readme * change dir name from custom plugins to test plugins * change root readme * update lockfile --------- Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
1 parent 0af4a20 commit d8ec95e

File tree

78 files changed

+1143
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1143
-722
lines changed

.betterer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const eslintPathsToIgnore = [
1010
'public/app/angular', // will be removed in Grafana 11
1111
'public/app/plugins/panel/graph', // will be removed alongside angular
1212
'public/app/plugins/panel/table-old', // will be removed alongside angular
13+
'e2e/test-plugins',
1314
];
1415

1516
// Avoid using functions that report the position of the issues, as this causes a lot of merge conflicts

.drone.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,14 @@ steps:
628628
volumes:
629629
- name: docker
630630
path: /var/run/docker.sock
631+
- commands:
632+
- yarn e2e:plugin:build
633+
depends_on:
634+
- yarn-install
635+
environment:
636+
NODE_OPTIONS: --max_old_space_size=8192
637+
image: node:20.9.0-alpine
638+
name: build-test-plugins
631639
- commands:
632640
- apk add --update tar bash
633641
- mkdir grafana
@@ -646,6 +654,7 @@ steps:
646654
- ./bin/build e2e-tests --port 3001 --suite dashboards-suite
647655
depends_on:
648656
- grafana-server
657+
- build-test-plugins
649658
environment:
650659
HOST: grafana-server
651660
image: cypress/included:13.10.0
@@ -654,6 +663,7 @@ steps:
654663
- ./bin/build e2e-tests --port 3001 --suite scenes/dashboards-suite
655664
depends_on:
656665
- grafana-server
666+
- build-test-plugins
657667
environment:
658668
HOST: grafana-server
659669
image: cypress/included:13.10.0
@@ -662,6 +672,7 @@ steps:
662672
- ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite
663673
depends_on:
664674
- grafana-server
675+
- build-test-plugins
665676
environment:
666677
HOST: grafana-server
667678
image: cypress/included:13.10.0
@@ -670,6 +681,7 @@ steps:
670681
- ./bin/build e2e-tests --port 3001 --suite scenes/smoke-tests-suite
671682
depends_on:
672683
- grafana-server
684+
- build-test-plugins
673685
environment:
674686
HOST: grafana-server
675687
image: cypress/included:13.10.0
@@ -678,6 +690,7 @@ steps:
678690
- ./bin/build e2e-tests --port 3001 --suite panels-suite
679691
depends_on:
680692
- grafana-server
693+
- build-test-plugins
681694
environment:
682695
HOST: grafana-server
683696
image: cypress/included:13.10.0
@@ -686,6 +699,7 @@ steps:
686699
- ./bin/build e2e-tests --port 3001 --suite scenes/panels-suite
687700
depends_on:
688701
- grafana-server
702+
- build-test-plugins
689703
environment:
690704
HOST: grafana-server
691705
image: cypress/included:13.10.0
@@ -694,6 +708,7 @@ steps:
694708
- ./bin/build e2e-tests --port 3001 --suite various-suite
695709
depends_on:
696710
- grafana-server
711+
- build-test-plugins
697712
environment:
698713
HOST: grafana-server
699714
image: cypress/included:13.10.0
@@ -702,6 +717,7 @@ steps:
702717
- ./bin/build e2e-tests --port 3001 --suite scenes/various-suite
703718
depends_on:
704719
- grafana-server
720+
- build-test-plugins
705721
environment:
706722
HOST: grafana-server
707723
image: cypress/included:13.10.0
@@ -738,6 +754,7 @@ steps:
738754
- yarn e2e:playwright
739755
depends_on:
740756
- grafana-server
757+
- build-test-plugins
741758
environment:
742759
HOST: grafana-server
743760
PORT: "3001"
@@ -2035,6 +2052,14 @@ steps:
20352052
volumes:
20362053
- name: docker
20372054
path: /var/run/docker.sock
2055+
- commands:
2056+
- yarn e2e:plugin:build
2057+
depends_on:
2058+
- yarn-install
2059+
environment:
2060+
NODE_OPTIONS: --max_old_space_size=8192
2061+
image: node:20.9.0-alpine
2062+
name: build-test-plugins
20382063
- commands:
20392064
- apk add --update tar bash
20402065
- mkdir grafana
@@ -2053,6 +2078,7 @@ steps:
20532078
- ./bin/build e2e-tests --port 3001 --suite dashboards-suite
20542079
depends_on:
20552080
- grafana-server
2081+
- build-test-plugins
20562082
environment:
20572083
HOST: grafana-server
20582084
image: cypress/included:13.10.0
@@ -2061,6 +2087,7 @@ steps:
20612087
- ./bin/build e2e-tests --port 3001 --suite scenes/dashboards-suite
20622088
depends_on:
20632089
- grafana-server
2090+
- build-test-plugins
20642091
environment:
20652092
HOST: grafana-server
20662093
image: cypress/included:13.10.0
@@ -2069,6 +2096,7 @@ steps:
20692096
- ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite
20702097
depends_on:
20712098
- grafana-server
2099+
- build-test-plugins
20722100
environment:
20732101
HOST: grafana-server
20742102
image: cypress/included:13.10.0
@@ -2077,6 +2105,7 @@ steps:
20772105
- ./bin/build e2e-tests --port 3001 --suite scenes/smoke-tests-suite
20782106
depends_on:
20792107
- grafana-server
2108+
- build-test-plugins
20802109
environment:
20812110
HOST: grafana-server
20822111
image: cypress/included:13.10.0
@@ -2085,6 +2114,7 @@ steps:
20852114
- ./bin/build e2e-tests --port 3001 --suite panels-suite
20862115
depends_on:
20872116
- grafana-server
2117+
- build-test-plugins
20882118
environment:
20892119
HOST: grafana-server
20902120
image: cypress/included:13.10.0
@@ -2093,6 +2123,7 @@ steps:
20932123
- ./bin/build e2e-tests --port 3001 --suite scenes/panels-suite
20942124
depends_on:
20952125
- grafana-server
2126+
- build-test-plugins
20962127
environment:
20972128
HOST: grafana-server
20982129
image: cypress/included:13.10.0
@@ -2101,6 +2132,7 @@ steps:
21012132
- ./bin/build e2e-tests --port 3001 --suite various-suite
21022133
depends_on:
21032134
- grafana-server
2135+
- build-test-plugins
21042136
environment:
21052137
HOST: grafana-server
21062138
image: cypress/included:13.10.0
@@ -2109,6 +2141,7 @@ steps:
21092141
- ./bin/build e2e-tests --port 3001 --suite scenes/various-suite
21102142
depends_on:
21112143
- grafana-server
2144+
- build-test-plugins
21122145
environment:
21132146
HOST: grafana-server
21142147
image: cypress/included:13.10.0
@@ -2145,6 +2178,7 @@ steps:
21452178
- yarn e2e:playwright
21462179
depends_on:
21472180
- grafana-server
2181+
- build-test-plugins
21482182
environment:
21492183
HOST: grafana-server
21502184
PORT: "3001"
@@ -6074,6 +6108,6 @@ kind: secret
60746108
name: gcr_credentials
60756109
---
60766110
kind: signature
6077-
hmac: cd0bc27b34a09de191974f360d43b55324bd88d20c4fe92f7c41df56394fc25a
6111+
hmac: 7c752913b444e0efe410d5a8a0d300e1b4d48d2cac8df602c35314bc62b7ac3c
60786112

60796113
...

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ node_modules
1313
/public/lib/monaco
1414
/scripts/grafana-server/tmp
1515
vendor
16-
e2e/custom-plugins
16+
e2e/test-plugins
1717
playwright-report
1818

1919
# TS generate from cue by cuetsy

devenv/plugins.yaml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
apiVersion: 1
22

33
apps:
4-
- type: myorg-extensions-app
4+
- type: grafana-extensionstest-app
55
org_id: 1
66
org_name: Main Org.
77
disabled: false
8-
- type: myorg-a-app
8+
jsonData:
9+
apiUrl: http://default-url.com
10+
secureJsonData:
11+
apiKey: secret-key
12+
- type: grafana-extensionexample1-app
913
org_id: 1
1014
org_name: Main Org.
1115
disabled: false
12-
- type: myorg-b-app
13-
org_id: 1
14-
org_name: Main Org.
15-
disabled: false
16-
- type: myorg-extensionpoint-app
17-
org_id: 1
18-
org_name: Main Org.
19-
disabled: false
20-
- type: myorg-componentconsumer-app
21-
org_id: 1
22-
org_name: Main Org.
23-
disabled: false
24-
- type: myorg-componentexposer-app
16+
- type: grafana-extensionexample2-app
2517
org_id: 1
2618
org_name: Main Org.
2719
disabled: false

e2e/custom-plugins/README.md

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

e2e/custom-plugins/app-with-exposed-components/README.md

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

e2e/custom-plugins/app-with-exposed-components/module.js

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

e2e/custom-plugins/app-with-exposed-components/plugin.json

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

e2e/custom-plugins/app-with-exposed-components/plugins/myorg-componentexposer-app/module.js

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

e2e/custom-plugins/app-with-extension-point/README.md

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

0 commit comments

Comments
 (0)