Skip to content

Commit

Permalink
Fix engine test by using query hash instead of serialized params
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum committed Jul 9, 2024
1 parent 56fe6bc commit 6cb62f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/logql/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,6 @@ func TestEngine_InstantQuery(t *testing.T) {
} {
test := test
t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) {
t.Parallel()

eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger())

Expand Down Expand Up @@ -2735,6 +2734,11 @@ func (q *querierRecorder) SelectSamples(_ context.Context, p SelectSampleParams)
}

func paramsID(p interface{}) string {
switch params := p.(type) {
case SelectLogParams:
case SelectSampleParams:
return fmt.Sprintf("%d", params.Plan.Hash())
}
b, err := json.Marshal(p)
if err != nil {
panic(err)
Expand Down

0 comments on commit 6cb62f2

Please sign in to comment.