Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into update-dskit
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Jul 29, 2024
2 parents 1f1ef3e + cfbce4d commit 22e75d9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions modules/frontend/search_sharder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ func TestBuildBackendRequests(t *testing.T) {
}

assert.NoError(t, ctx.Err())
assert.Equal(t, tc.expectedURIs, actualURIs)

urisEqual(t, tc.expectedURIs, actualURIs)
}
}

Expand Down Expand Up @@ -329,7 +330,7 @@ func TestBackendRequests(t *testing.T) {
}
}
require.NoError(t, ctx.Err())
require.Equal(t, tc.expectedReqsURIs, actualReqURIs)
urisEqual(t, tc.expectedReqsURIs, actualReqURIs)
})
}
}
Expand Down Expand Up @@ -866,3 +867,21 @@ func TestHashTraceQLQuery(t *testing.T) {
h2 = hashForSearchRequest(&tempopb.SearchRequest{Query: "{ span.foo = `bar` }", SpansPerSpanSet: 2})
require.NotEqual(t, h1, h2)
}

func urisEqual(t *testing.T, expectedURIs, actualURIs []string) {
require.Equal(t, len(expectedURIs), len(actualURIs))

for i, expected := range expectedURIs {
actual := actualURIs[i]

e, err := url.Parse(expected)
require.NoError(t, err)
a, err := url.Parse(actual)
require.NoError(t, err)

e.RawQuery = e.Query().Encode()
a.RawQuery = a.Query().Encode()

assert.Equal(t, e, a)
}
}

0 comments on commit 22e75d9

Please sign in to comment.