From 14a61d9cd89f2084eb938fdadd5fa9667b535d4a Mon Sep 17 00:00:00 2001 From: spinillos Date: Mon, 29 Apr 2024 16:43:26 +0200 Subject: [PATCH] Use fixed mimir version and fix test rules --- integration/mimir/rules_test.go | 14 +++++++------- integration/mimir/testdata/test-rules-1.yml | 1 + integration/mimir/testdata/test-rules-2.yml | 1 + integration/mimir/testdata/test-rules-3.yml | 1 + pkg/testutil/testutil.go | 2 +- test-docker-compose/docker-compose.yml | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/integration/mimir/rules_test.go b/integration/mimir/rules_test.go index 6687be15..361f48d1 100644 --- a/integration/mimir/rules_test.go +++ b/integration/mimir/rules_test.go @@ -1,24 +1,24 @@ package mimir import ( + "os" + "path/filepath" + "sort" + "strings" + "testing" + "github.com/grafana/grizzly/pkg/grizzly" "github.com/grafana/grizzly/pkg/mimir" "github.com/grafana/grizzly/pkg/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" - "os" - "path/filepath" - "sort" - "strings" - "testing" ) func TestRules(t *testing.T) { provider, err := mimir.NewProvider(&testutil.TestContext().Mimir) require.NoError(t, err) - - handler := mimir.NewRuleHandler(provider) + handler := provider.GetHandlers()[0] t.Run("create rule group", func(t *testing.T) { dirs, err := os.ReadDir("testdata") diff --git a/integration/mimir/testdata/test-rules-1.yml b/integration/mimir/testdata/test-rules-1.yml index e5435d7c..748d4f8b 100644 --- a/integration/mimir/testdata/test-rules-1.yml +++ b/integration/mimir/testdata/test-rules-1.yml @@ -2,6 +2,7 @@ apiVersion: grizzly.grafana.com/v1alpha1 kind: RuleGroup1 metadata: name: test-rules-1 + namespace: test-rules-1 spec: name: MyRules1 rules: diff --git a/integration/mimir/testdata/test-rules-2.yml b/integration/mimir/testdata/test-rules-2.yml index 11f0cc32..f050c6f9 100644 --- a/integration/mimir/testdata/test-rules-2.yml +++ b/integration/mimir/testdata/test-rules-2.yml @@ -2,6 +2,7 @@ apiVersion: grizzly.grafana.com/v1alpha1 kind: RuleGroup2 metadata: name: test-rules-2 + namespace: test-rules-2 spec: name: MyRules2 rules: diff --git a/integration/mimir/testdata/test-rules-3.yml b/integration/mimir/testdata/test-rules-3.yml index f354f588..14a495ae 100644 --- a/integration/mimir/testdata/test-rules-3.yml +++ b/integration/mimir/testdata/test-rules-3.yml @@ -2,6 +2,7 @@ apiVersion: grizzly.grafana.com/v1alpha1 kind: RuleGroup3 metadata: name: test-rules-3 + namespace: test-rules-3 spec: name: MyRules3 rules: diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go index 60f0bf81..50da1c90 100644 --- a/pkg/testutil/testutil.go +++ b/pkg/testutil/testutil.go @@ -12,7 +12,7 @@ func TestContext() *config.Context { Mimir: config.MimirConfig{ Address: "http://localhost:9009", TenantID: "demo", - ApiKey: "abc", + APIKey: "abc", }, } return &ctx diff --git a/test-docker-compose/docker-compose.yml b/test-docker-compose/docker-compose.yml index d43465bd..87e077f8 100644 --- a/test-docker-compose/docker-compose.yml +++ b/test-docker-compose/docker-compose.yml @@ -68,7 +68,7 @@ services: start_period: 10s mimir: - image: grafana/mimir:latest + image: grafana/mimir:2.12.0 command: [ "-config.file=/etc/mimir.yaml" ] hostname: mimir volumes: