-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[ES][v1] Change the DB Tag value from string
to any
type
#6998
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
Conversation
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
@@ -16,11 +16,12 @@ import ( | |||
"github.com/jaegertracing/jaeger/internal/storage/elasticsearch/dbmodel" | |||
) | |||
|
|||
func CompareJSONSpans(t *testing.T, expected *dbmodel.Span, actual *dbmodel.Span) { | |||
sortJSONSpan(expected) | |||
sortJSONSpan(actual) |
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.
I don't know the reason of testing JSON Spans this way, but this way was leading to a problem that JSON decode treats every number as float64 which was failing the tests. Therefore we shouldn't be decoding and then asserting rather it should be encoding the expected span and then asserting!
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.
I think if you're getting differences there may be something wrong with the translation. Despite the name "JSON" the function CompareJSONSpans was comparing two db spans as Go objects. After your change this function is no different than testJSONEncoding
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.
I don't think so as the problem lies in unmarshaling, the expected span is unmarshalled from the fixture data, when we change the values from string to any in fixtures (that is change "12345" to 12345) then it change it's type to float64 from int64 so in test the expected span expects float64
everywhere where it should have expected int64
. Earlier it was not a problem because every value was a string!
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.
fair, but now this function is no different from testJSONEncoding
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.
Should we remove it?
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.
@yurishkuro Can we remove it? Or should we employ some other strategy like after marshalling converting all the int back to int64
from float64
? These 2 PRs are blocker for embedding tagDotReplacement
so can you please provide an overview over this?
Integration tests have been passed and unit tests are passing locally, can we re-run them in CI? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6998 +/- ##
==========================================
+ Coverage 95.97% 95.99% +0.02%
==========================================
Files 346 346
Lines 20429 20474 +45
==========================================
+ Hits 19606 19655 +49
+ Misses 620 618 -2
+ Partials 203 201 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
there are a lot of untested/uncovered code paths, can we not add table driven tests to capture them?
@yurishkuro Unit Tests have failed due to unknown reason, can you please re-run them in CI to see the real code coverage? |
1eac31e
…racing#6998) ## Which problem is this PR solving? - Discussed in jaegertracing#6994 ## Description of the changes - We shouldn't be storing values as string in ES rather they should be stored raw but due to some unkown reason they were being stored as string so now backward compatibility should be considered for the old data and new data should be stored as raw ## How was this change tested? - Unit and E2E Tests ## 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: Manik2708 <[email protected]>
…racing#6998) ## Which problem is this PR solving? - Discussed in jaegertracing#6994 ## Description of the changes - We shouldn't be storing values as string in ES rather they should be stored raw but due to some unkown reason they were being stored as string so now backward compatibility should be considered for the old data and new data should be stored as raw ## How was this change tested? - Unit and E2E Tests ## 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: Manik2708 <[email protected]> Signed-off-by: amol-verma-allen <[email protected]>
Which problem is this PR solving?
string
toany
type #6994Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test