Migrate dd-trace-ot tests to JUnit 5#11483
Conversation
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
This comment has been minimized.
This comment has been minimized.
bric3
left a comment
There was a problem hiding this comment.
Left a few conversion-fidelity notes. These are about preserving the old Spock assertions, not expanding the test scope.
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
Left minor nit comments
fd00951 to
89d950f
Compare
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
LGTM
left minor comments
|
|
||
| abstract class CorrelationIdInjectorTest extends DDJavaSpecification { | ||
|
|
||
| protected String logPattern = |
There was a problem hiding this comment.
nit: I think it is a const now?
if yes, it should be protected static final String LOG_PATTERN = ....
| List<String> events; | ||
| int read; | ||
| PatternLayoutEncoder encoder; |
There was a problem hiding this comment.
nit: should this be private final? (except int read).
| ListWriter writer = new ListWriter(); | ||
| Tracer tracer = DDTracer.builder().writer(writer).build(); |
There was a problem hiding this comment.
nit: private final?
|
|
||
| class DDTracerResolverTest extends DDJavaSpecification { | ||
|
|
||
| DDTracerResolver resolver = new DDTracerResolver(); |
There was a problem hiding this comment.
nit: private final
| @SuppressWarnings("unchecked") | ||
| private static <T> T getField(Object obj, String fieldName) throws Exception { | ||
| Class<?> cls = obj.getClass(); | ||
| while (cls != null) { | ||
| try { | ||
| Field field = cls.getDeclaredField(fieldName); | ||
| field.setAccessible(true); | ||
| return (T) field.get(obj); | ||
| } catch (NoSuchFieldException ignored) { | ||
| cls = cls.getSuperclass(); | ||
| } | ||
| } | ||
| throw new NoSuchFieldException("Field " + fieldName + " not found on " + obj.getClass()); | ||
| } |
There was a problem hiding this comment.
optional: Probably looks like a good candidate to be in base class?
| ListWriter writer = new ListWriter(); | ||
| CoreTracer tracer = CoreTracer.builder().writer(writer).build(); |
There was a problem hiding this comment.
nit: private final
|
@amarziali once all tests of the module are migrated you need to add the module to this file: https://github.com/DataDog/dd-trace-java/pull/10787/changes#diff-3bcd5c5c739a45cfe3a5281b82797f6b8e36073cab801c6609f6e8a6508b858f |
What Does This Do
Migrates groovy tests in dd-trace-ot to Junit5
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-levelJira ticket: [PROJ-IDENT]