Port TraceMapperV0_4/V0_5 payload tests from Spock to JUnit 5#11871
Draft
dougqh wants to merge 1 commit into
Draft
Port TraceMapperV0_4/V0_5 payload tests from Spock to JUnit 5#11871dougqh wants to merge 1 commit into
dougqh wants to merge 1 commit into
Conversation
Migrate TraceMapperV04PayloadTest and TraceMapperV05PayloadTest from Groovy/Spock to JUnit 5 Java (V0.1/V1 deferred). The two `where:` tables become @MethodSource providers (preserving the `10<<10` shift intent), the V0.4 metaStruct closure becomes a @FunctionalInterface, and the format-agnostic decode helpers (assertEqualsWithNullAsEmpty, the metrics unpackNumber switch, and the growable capturing channel) are extracted to a shared PayloadVerifiers helper reused by both. The two format-specific PayloadVerifiers stay per-test since V0.4 (inline strings) and V0.5 (dictionary-compressed indices) decode different wire formats. Two behaviors DDSpecification/Groovy provided implicitly are made explicit: (1) numeric metrics are compared via longValue() — Groovy's dynamic dispatch routed assertEquals(Long,Integer) to the primitive long overload, whereas Java's static resolution would compare by reference type after msgpack's minimal encoding narrows a Long to an Integer; (2) the ProcessTags static is re-synced to the per-test Config via @ExtendWith(WithConfigExtension) + a @beforeeach, with the overflow test disabling process tags via @WithConfig. Test count is unchanged (V0.4=23, V0.5=30). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Contributor
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates
TraceMapperV04PayloadTestandTraceMapperV05PayloadTestfrom Groovy/Spock to JUnit 5 Java.TraceMapperV1PayloadTestandTraceMapperTestare left untouched (V1 is newer and not yet in production — deferred).Details
where:tables →@MethodSourceproviders, preserving the10<<10/100<<10shift intent (not flattened to decimals).metaStructverifier closure → a@FunctionalInterface MetaStructVerifier<E>.assertEqualsWithNullAsEmpty, the metricsunpackNumberswitch, and the growable capturingWritableByteChannel— are extracted to a sharedPayloadVerifiershelper reused by both tests. The twoPayloadVerifiers themselves stay per-test because V0.4 (inline strings) and V0.5 (dictionary-compressed string indices) decode different wire formats.Two behaviors that
DDSpecification/ Groovy provided implicitly are now explicit:longValue(). Groovy's dynamic dispatch routedassertEquals(Long, Integer)to the primitiveassertEquals(long, long)overload (numeric equality); Java's static overload resolution would pick theObjectoverload and compare by reference type, which fails once msgpack's minimal encoding narrows aLongthread id back to anInteger.ProcessTagsstatic is re-synced to the per-testConfigvia@ExtendWith(WithConfigExtension.class)+ a@BeforeEach, and the body-overflow test disables process tags with@WithConfig(so the dictionary-size calculation stays stable).Testing
Test count is unchanged: V0.4 = 23, V0.5 = 30 (53 total), all green. Verified the original Groovy suite passes in the same environment before porting.
🤖 Generated with Claude Code