@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 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.0",
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": "31b8a33141248ccb27ab8278adbbfc452c35d912"
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 "true"
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
- apk add supervisor inotify-tools git; \
35
+ apk add supervisor inotify-tools git; \
36
36
  elif grep -i -q ubuntu /etc/issue; then \
37
- DEBIAN_FRONTEND=noninteractive && \
38
- apt-get update && \
39
- apt-get install -y supervisor inotify-tools git && \
40
- rm -rf /var/lib/apt/lists/*; \
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
- echo 'ERROR: Unsupported base image' && /bin/false; \
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.3.1",{{/if}}
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}}
@@ -9,6 +9,7 @@ services:
9
9
  grafana_image: ${GRAFANA_IMAGE:-{{~grafanaImage~}} }
10
10
  grafana_version: ${GRAFANA_VERSION:-11.3.2}
11
11
  development: ${DEVELOPMENT:-false}
12
+ anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true}
12
13
  ports:
13
14
  - 3000:3000/tcp
14
15
  {{#if hasBackend}}
@@ -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('{{kebabToPascalKebab pluginName }}');
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('{{kebabToPascalKebab pluginName }}');
34
- await panelEditPage.collapseSection('{{kebabToPascalKebab pluginName }}');
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('{{kebabToPascalKebab pluginName }} Show series counter')
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')