From 4fbc360210096d838bf8fb57949dbb8b7af8f920 Mon Sep 17 00:00:00 2001 From: Edward Welch Date: Thu, 4 Apr 2024 19:37:43 +0000 Subject: [PATCH] fix tests Signed-off-by: Edward Welch --- pkg/loki/config_test.go | 5 +++++ pkg/loki/modules_test.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/pkg/loki/config_test.go b/pkg/loki/config_test.go index 0fa36ea2ba9d4..1642213f6739f 100644 --- a/pkg/loki/config_test.go +++ b/pkg/loki/config_test.go @@ -69,6 +69,11 @@ func TestCrossComponentValidation(t *testing.T) { tc.base.RegisterFlags(flag.NewFlagSet(tc.desc, 0)) // This test predates the newer schema required for structured metadata tc.base.LimitsConfig.AllowStructuredMetadata = false + // Several caches will error if not configured, disabled them for this test + tc.base.QueryRange.CacheIndexStatsResults = false + tc.base.QueryRange.CacheSeriesResults = false + tc.base.QueryRange.CacheLabelResults = false + tc.base.QueryRange.CacheVolumeResults = false err := tc.base.Validate() if tc.err { require.NotNil(t, err) diff --git a/pkg/loki/modules_test.go b/pkg/loki/modules_test.go index 989d8e588c0de..90c0b887dd02e 100644 --- a/pkg/loki/modules_test.go +++ b/pkg/loki/modules_test.go @@ -380,6 +380,12 @@ func minimalWorkingConfig(t *testing.T, dir, target string, cfgTransformers ...f }, } + // Disable some caches otherwise we'll get errors if we don't configure them + cfg.QueryRange.CacheLabelResults = false + cfg.QueryRange.CacheSeriesResults = false + cfg.QueryRange.CacheIndexStatsResults = false + cfg.QueryRange.CacheVolumeResults = false + cfg.SchemaConfig = config.SchemaConfig{ Configs: []config.PeriodConfig{ {