From 682d9044c4e83c963c1c8a3d41a6cb3c6a307aca Mon Sep 17 00:00:00 2001 From: Zihan Dai <1436286758@qq.com> Date: Tue, 20 Oct 2026 21:42:21 +1100 Subject: [PATCH] Run the Grafana plugin's unit tests in CI The build job's frontend step is named "Build and test frontend" but only builds, and nothing runs the Go tests either, so the 38 Jest tests and the backend tests under pkg/plugin never run in CI. Run `npm run test:ci` before the frontend build, and `go test ./pkg/...` after backend-compile.sh, which is what resolves go.sum. Signed-off-by: Zihan Dai <1436286758@qq.com> --- .github/workflows/grafana-plugin.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/grafana-plugin.yml b/.github/workflows/grafana-plugin.yml index 34cf4b02..110e97f8 100644 --- a/.github/workflows/grafana-plugin.yml +++ b/.github/workflows/grafana-plugin.yml @@ -43,6 +43,7 @@ jobs: run: | cd connectors/grafana-plugin/ npm ci + npm run test:ci npm run build - name: Install dependencies and Build backend @@ -50,6 +51,12 @@ jobs: cd connectors/grafana-plugin/ ./backend-compile.sh + # go.sum is not checked in; backend-compile.sh resolves it, so the tests run after it. + - name: Test backend + run: | + cd connectors/grafana-plugin/ + go test ./pkg/... + # The job above exercises the npm path directly. This one exercises the Maven # entrypoint (`mvn -Pwith-grafana-plugin`), which drives the same frontend build # through frontend-maven-plugin. Without it that path is unverified: the module is