-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] Fix test expectations for translator to avoid depending on order #6404
[fix] Fix test expectations for translator to avoid depending on order #6404
Conversation
Signed-off-by: Mahad Zaryab <[email protected]>
can you elaborate what this means? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6404 +/- ##
==========================================
- Coverage 96.29% 96.27% -0.02%
==========================================
Files 367 367
Lines 20978 20978
==========================================
- Hits 20200 20197 -3
- Misses 595 597 +2
- Partials 183 184 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
If we pass in |
assert.Equal(t, 2, ss1.Spans().Len()) | ||
spanMap := make(map[string]ptrace.Span) | ||
|
||
for i := 0; i < traces.ResourceSpans().Len(); i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
considering how often we seem to be doing this I would create a helper
package jptrace
func SpanMap[K](tr ptrace.Traces, keyFn func (ptrace.Span) K) map[K]ptrace.Span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good - can do in a follow-up PR
jaegertracing#6404) ## Description of the changes - The output of `ProtoToTraces` is not guaranteed to be in order which was causing flaky test failures in `translator_test.go`. This PR changes the test expectations to not depend on the return order of `ProtoToTraces`. ## How was this change tested? - CI ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` Signed-off-by: Mahad Zaryab <[email protected]>
Description of the changes
ProtoToTraces
is not guaranteed to be in order which was causing flaky test failures intranslator_test.go
. This PR changes the test expectations to not depend on the return order ofProtoToTraces
.How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test