-
Notifications
You must be signed in to change notification settings - Fork 477
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 flaky test causing spurious drops in code coverage #1632
Conversation
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1632 +/- ##
==========================================
+ Coverage 95.99% 96.01% +0.02%
==========================================
Files 242 242
Lines 7559 7559
Branches 1984 1984
==========================================
+ Hits 7256 7258 +2
+ Misses 303 301 -2 ☔ View full report in Codecov by Sentry. |
could you please explain why this change works? |
So that atleast once in the test if block will be executed Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Here I am trying to execute if code block at least once . As previously getViewBounds function always returns {start:0,end:1} so always else block is executed in test jaeger-ui/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanBarRow.tsx Lines 117 to 122 in b4a49a7
|
two different mock returns are good if the function is guaranteed to be called multiple times in the test. Is it? |
Yes we are calling multiple times in the test file jaeger-ui/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanBarRow.test.js Lines 111 to 133 in b4a49a7
Indirectly for every shallow render getViewBounds function is called |
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.
thanks!
Which problem is this PR solving?
Short description of the changes