-
Notifications
You must be signed in to change notification settings - Fork 231
[jaeger-client-java/jax-rs2] Remove jaeger-context dependence for JAX-RS2 jaeger instrumentation #319
[jaeger-client-java/jax-rs2] Remove jaeger-context dependence for JAX-RS2 jaeger instrumentation #319
Conversation
Codecov Report
@@ Coverage Diff @@
## master #319 +/- ##
============================================
+ Coverage 83.79% 84.17% +0.38%
- Complexity 563 565 +2
============================================
Files 91 91
Lines 2222 2225 +3
Branches 257 258 +1
============================================
+ Hits 1862 1873 +11
+ Misses 258 251 -7
+ Partials 102 101 -1
Continue to review full report at Codecov.
|
Related to #188 |
@@ -63,8 +60,7 @@ public void setUp() throws Exception { | |||
tracer = | |||
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true)) | |||
.build(); | |||
traceContext = new ScopeManagerTraceContext(tracer.scopeManager()); | |||
undertest = new ClientFilter(tracer, traceContext); | |||
undertest = new ClientFilter(tracer); |
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.
Doing this reduces code coverage because the deprecated methods are no longer exercised. Is there a way to exclude them from coverage?
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.
let me look around
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.
jacoco plugin version 0.8 seems to support this {PR}
Methods annotated with @lombok.Generated (generated by Lombok getters, setters, equals, hashcode, toString, etc)
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.
yeah, that looks dirty. Why not just invoke the deprecated methods here, like new ClientFilter(tracer, null);
? Strictly speaking just because a function is deprecated doesn't mean it does not need to work correctly, so exercising it in tests is a good thing.
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.
haha yes looks very wretched
yup! just gonna call the deprecate methods :)
@yurishkuro lombok generated annotation + jacoco 0.8 definitely seems to do the trick, but it is a little bit of a hack - depends on how you feel about 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.
Looks good, also remove the jaeger-context
subproject dependency in build.gradle
build.gradle
Outdated
@@ -46,6 +46,10 @@ allprojects { | |||
} | |||
} | |||
|
|||
jacoco { | |||
toolVersion = "0.8.0" |
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.
Is this still required?
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.
nah - not really; getting rid of it
@vprithvi Can't get rid of Deprecated methods will need it as compile time dep :( |
@@ -60,7 +57,7 @@ public void setUp() { | |||
tracer = | |||
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true)) | |||
.build(); | |||
undertest = new ServerFilter(tracer); | |||
undertest = new ServerFilter(tracer, null); |
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.
may want to add a comment "Using deprecated constructor for test coverage"
@@ -63,8 +60,7 @@ public void setUp() throws Exception { | |||
tracer = | |||
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true)) | |||
.build(); | |||
traceContext = new ScopeManagerTraceContext(tracer.scopeManager()); | |||
undertest = new ClientFilter(tracer, traceContext); | |||
undertest = new ClientFilter(tracer, null); |
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.
may want to add a comment "Using deprecated constructor for test coverage"
tracer.scopeManager().activate(currentSpan, true); | ||
when(clientRequestContext.getProperty(CURRENT_SPAN_CONTEXT_KEY)).thenReturn(currentSpan); | ||
|
||
// FIXME (debo): remove to use {@link ClientSpanInjectionFilter(Tracer)} |
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.
may want to add a comment "Using deprecated constructor for test coverage"
f2e5f18
to
4edc8cd
Compare
…-RS2 tracing instrumentation Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
…-RS2 tracing instrumentation Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
4edc8cd
to
7c02f90
Compare
rebased on master
|
can you rebase off master? |
nvm, I think I was able to do it myself |
Have not removed from
build.gradle
since deprecated classTracingUtils
still depends on it.