From 5368f8216e0776f80090601e67bd5374d210f54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 17 Oct 2026 19:32:56 +0000 Subject: [PATCH] metriccontract: read the moved dashboards and rendered rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The metric reference test globbed dashboard/*.json and picked up the rendered rules by walking contrib/mixin; both moved to contrib/. Signed-off-by: Jan-Otto Kröpke --- internal/metriccontract/metrics_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/metriccontract/metrics_test.go b/internal/metriccontract/metrics_test.go index 1530706e..d8052a7a 100644 --- a/internal/metriccontract/metrics_test.go +++ b/internal/metriccontract/metrics_test.go @@ -189,7 +189,7 @@ type reference struct { } // metricReferences returns the windows_ metric names in the collector -// documentation, the mixin sources and the generated dashboards. +// documentation, the mixin sources, the rendered rules and the generated dashboards. func metricReferences(t *testing.T) []reference { t.Helper() @@ -209,11 +209,16 @@ func metricReferences(t *testing.T) []reference { files = append(files, runbooks...) - dashboards, err := filepath.Glob(filepath.Join(repoRoot, "dashboard", "*.json")) + dashboards, err := filepath.Glob(filepath.Join(repoRoot, "contrib", "dashboard", "*.json")) require.NoError(t, err) files = append(files, dashboards...) + rules, err := filepath.Glob(filepath.Join(repoRoot, "contrib", "monitoring", "*.yaml")) + require.NoError(t, err) + + files = append(files, rules...) + err = filepath.WalkDir(filepath.Join(repoRoot, "contrib", "mixin"), func(path string, entry fs.DirEntry, err error) error { if err != nil { return err @@ -239,6 +244,7 @@ func metricReferences(t *testing.T) []reference { require.NoError(t, err) require.NotEmpty(t, docs) require.NotEmpty(t, dashboards) + require.NotEmpty(t, rules) var refs []reference