@grafana/create-plugin 5.12.0 → 5.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/templates/backend/tests/configEditor.spec.ts +5 -0
- package/templates/backend/tests/queryEditor.spec.ts +7 -0
- package/templates/common/.config/Dockerfile +7 -7
- package/templates/common/_package.json +1 -1
- package/templates/common/docker-compose.yaml +1 -0
- package/templates/datasource/tests/configEditor.spec.ts +6 -0
- package/templates/datasource/tests/queryEditor.spec.ts +7 -0
- package/templates/github/workflows/ci.yml +3 -1
- package/templates/panel/tests/panel.spec.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# v5.12.1 (Thu Dec 19 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Fix scaffolded panel plugin tests [#1421](https://github.com/grafana/plugin-tools/pull/1421) ([@sunker](https://github.com/sunker))
|
|
6
|
+
- Update dependency @grafana/e2e-selectors to v11.4.0 [#1412](https://github.com/grafana/plugin-tools/pull/1412) ([@renovate[bot]](https://github.com/renovate[bot]))
|
|
7
|
+
|
|
8
|
+
#### Authors: 2
|
|
9
|
+
|
|
10
|
+
- [@renovate[bot]](https://github.com/renovate[bot])
|
|
11
|
+
- Erik Sundell ([@sunker](https://github.com/sunker))
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
# v5.12.0 (Wed Dec 18 2024)
|
|
2
16
|
|
|
3
17
|
#### 🚀 Enhancement
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=20"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "4ab1966bea18043ca8e76bac1f3e6b5ef06da141"
|
|
90
90
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { test, expect } from '@grafana/plugin-e2e';
|
|
2
2
|
import { MyDataSourceOptions, MySecureJsonData } from '../src/types';
|
|
3
3
|
|
|
4
|
+
test('smoke: should render config editor', async ({ createDataSourceConfigPage, readProvisionedDataSource, page }) => {
|
|
5
|
+
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });;
|
|
6
|
+
await createDataSourceConfigPage({ type: ds.type });
|
|
7
|
+
await expect(page.getByLabel('Path')).toBeVisible();
|
|
8
|
+
});
|
|
4
9
|
test('"Save & test" should be successful when configuration is valid', async ({
|
|
5
10
|
createDataSourceConfigPage,
|
|
6
11
|
readProvisionedDataSource,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { test, expect } from '@grafana/plugin-e2e';
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
test('smoke: should render query editor', async ({ panelEditPage, readProvisionedDataSource }) => {
|
|
5
|
+
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });
|
|
6
|
+
await panelEditPage.datasource.set(ds.name);
|
|
7
|
+
await expect(panelEditPage.getQueryEditorRow('A').getByRole('textbox', { name: 'Query Text' })).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
3
10
|
test('should trigger new query when Constant field is changed', async ({
|
|
4
11
|
panelEditPage,
|
|
5
12
|
readProvisionedDataSource,
|
|
@@ -16,7 +16,7 @@ ENV DEV "${development}"
|
|
|
16
16
|
# Make it as simple as possible to access the grafana instance for development purposes
|
|
17
17
|
# Do NOT enable these settings in a public facing / production grafana instance
|
|
18
18
|
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
|
|
19
|
-
ENV GF_AUTH_ANONYMOUS_ENABLED "
|
|
19
|
+
ENV GF_AUTH_ANONYMOUS_ENABLED "{anonymous_auth_enabled}"
|
|
20
20
|
ENV GF_AUTH_BASIC_ENABLED "false"
|
|
21
21
|
# Set development mode so plugins can be loaded without the need to sign
|
|
22
22
|
ENV GF_DEFAULT_APP_MODE "development"
|
|
@@ -32,14 +32,14 @@ USER root
|
|
|
32
32
|
# Installing supervisor and inotify-tools
|
|
33
33
|
RUN if [ "${development}" = "true" ]; then \
|
|
34
34
|
if grep -i -q alpine /etc/issue; then \
|
|
35
|
-
|
|
35
|
+
apk add supervisor inotify-tools git; \
|
|
36
36
|
elif grep -i -q ubuntu /etc/issue; then \
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
DEBIAN_FRONTEND=noninteractive && \
|
|
38
|
+
apt-get update && \
|
|
39
|
+
apt-get install -y supervisor inotify-tools git && \
|
|
40
|
+
rm -rf /var/lib/apt/lists/*; \
|
|
41
41
|
else \
|
|
42
|
-
|
|
42
|
+
echo 'ERROR: Unsupported base image' && /bin/false; \
|
|
43
43
|
fi \
|
|
44
44
|
fi
|
|
45
45
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
{{#if useCypress}} "@grafana/e2e": "^11.0.7",
|
|
22
|
-
"@grafana/e2e-selectors": "^11.
|
|
22
|
+
"@grafana/e2e-selectors": "^11.4.0",{{/if}}
|
|
23
23
|
"@grafana/eslint-config": "^8.0.0",{{#if usePlaywright}}
|
|
24
24
|
"@grafana/plugin-e2e": "^1.13.1",{{/if}}
|
|
25
25
|
"@grafana/tsconfig": "^2.0.0",{{#if usePlaywright}}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { test, expect } from '@grafana/plugin-e2e';
|
|
2
2
|
import { MyDataSourceOptions, MySecureJsonData } from '../src/types';
|
|
3
3
|
|
|
4
|
+
test('smoke: should render config editor', async ({ createDataSourceConfigPage, readProvisionedDataSource, page }) => {
|
|
5
|
+
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });;
|
|
6
|
+
await createDataSourceConfigPage({ type: ds.type });
|
|
7
|
+
await expect(page.getByLabel('Path')).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
4
10
|
test('"Save & test" should be successful when configuration is valid', async ({
|
|
5
11
|
createDataSourceConfigPage,
|
|
6
12
|
readProvisionedDataSource,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { test, expect } from '@grafana/plugin-e2e';
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
test('smoke: should render query editor', async ({ panelEditPage, readProvisionedDataSource }) => {
|
|
5
|
+
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });
|
|
6
|
+
await panelEditPage.datasource.set(ds.name);
|
|
7
|
+
await expect(panelEditPage.getQueryEditorRow('A').getByRole('textbox', { name: 'Query Text' })).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
3
10
|
test('data query should return a value', async ({ panelEditPage, readProvisionedDataSource }) => {
|
|
4
11
|
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });
|
|
5
12
|
await panelEditPage.datasource.set(ds.name);
|
|
@@ -189,10 +189,12 @@ jobs:
|
|
|
189
189
|
- name: Start Grafana
|
|
190
190
|
run: |
|
|
191
191
|
docker compose pull
|
|
192
|
-
DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d
|
|
192
|
+
ANONYMOUS_AUTH_ENABLED=false DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d
|
|
193
193
|
|
|
194
194
|
- name: Wait for grafana server
|
|
195
195
|
uses: grafana/plugin-actions/wait-for-grafana@main
|
|
196
|
+
with:
|
|
197
|
+
url: http://localhost:3000/login
|
|
196
198
|
|
|
197
199
|
- name: Install Playwright Browsers
|
|
198
200
|
run: {{ packageManagerName }} exec playwright install chromium --with-deps
|
|
@@ -17,7 +17,7 @@ test('should display circle when data is passed to the panel', async ({
|
|
|
17
17
|
}) => {
|
|
18
18
|
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });
|
|
19
19
|
await panelEditPage.datasource.set(ds.name);
|
|
20
|
-
await panelEditPage.setVisualization('{{
|
|
20
|
+
await panelEditPage.setVisualization('{{titleCase pluginName }}');
|
|
21
21
|
await expect(page.getByTestId('simple-panel-circle')).toBeVisible();
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -30,11 +30,11 @@ test('should display series counter when "Show series counter" option is enabled
|
|
|
30
30
|
}) => {
|
|
31
31
|
const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' });
|
|
32
32
|
await panelEditPage.datasource.set(ds.name);
|
|
33
|
-
await panelEditPage.setVisualization('{{
|
|
34
|
-
await panelEditPage.collapseSection('{{
|
|
33
|
+
await panelEditPage.setVisualization('{{titleCase pluginName }}');
|
|
34
|
+
await panelEditPage.collapseSection('{{titleCase pluginName }}');
|
|
35
35
|
await expect(page.getByTestId('simple-panel-circle')).toBeVisible();
|
|
36
36
|
const seriesCounterLabel = panelEditPage.getByGrafanaSelector(
|
|
37
|
-
selectors.components.PanelEditor.OptionsPane.fieldLabel('{{
|
|
37
|
+
selectors.components.PanelEditor.OptionsPane.fieldLabel('{{titleCase pluginName }} Show series counter')
|
|
38
38
|
);
|
|
39
39
|
const switchField = semver.gte(grafanaVersion, '11.4.0')
|
|
40
40
|
? seriesCounterLabel.getByRole('switch')
|