From 1a58b18bdcd1ecbe2a9e7d84fb7a472143f00e15 Mon Sep 17 00:00:00 2001 From: Sebastian Rabenhorst Date: Wed, 3 May 2023 15:20:40 +0200 Subject: [PATCH] Use NewQueryEngineFactory in tests --- pkg/api/query/v1_test.go | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/pkg/api/query/v1_test.go b/pkg/api/query/v1_test.go index 0f6234bcc2f..9fcf71c6fcf 100644 --- a/pkg/api/query/v1_test.go +++ b/pkg/api/query/v1_test.go @@ -183,14 +183,12 @@ func TestQueryEndpoints(t *testing.T) { now := time.Now() timeout := 100 * time.Second - ef := &QueryEngineFactory{ - engineOpts: promql.EngineOpts{ - Logger: nil, - Reg: nil, - MaxSamples: 10000, - Timeout: timeout, - }, - } + ef := NewQueryEngineFactory(promql.EngineOpts{ + Logger: nil, + Reg: nil, + MaxSamples: 10000, + Timeout: timeout, + }, nil) api := &QueryAPI{ baseAPI: &baseAPI.BaseAPI{ Now: func() time.Time { return now }, @@ -727,14 +725,12 @@ func TestMetadataEndpoints(t *testing.T) { now := time.Now() timeout := 100 * time.Second - ef := &QueryEngineFactory{ - engineOpts: promql.EngineOpts{ - Logger: nil, - Reg: nil, - MaxSamples: 10000, - Timeout: timeout, - }, - } + ef := NewQueryEngineFactory(promql.EngineOpts{ + Logger: nil, + Reg: nil, + MaxSamples: 10000, + Timeout: timeout, + }, nil) api := &QueryAPI{ baseAPI: &baseAPI.BaseAPI{ Now: func() time.Time { return now },