Skip to content

[FLINK-40207][table-runtime] Modernize BinaryStringDataTest with JUnit 5 - #29023

Open
raminqaf wants to merge 8 commits into
apache:masterfrom
raminqaf:FLINK-40207-junit5-tests
Open

[FLINK-40207][table-runtime] Modernize BinaryStringDataTest with JUnit 5#29023
raminqaf wants to merge 8 commits into
apache:masterfrom
raminqaf:FLINK-40207-junit5-tests

Conversation

@raminqaf

@raminqaf raminqaf commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Test-only follow-up to the FLINK-40207 cast fix. BinaryStringDataTest used Flink's custom ParameterizedTestExtension (constructor-injected Mode, @TestTemplate, @Parameters), and several methods bundled many unrelated scenarios into one body. This reworks it to plain JUnit 5 for readability and more granular reporting. There is no production code change and no behavior change under test.

Brief change log

  • Replaced ParameterizedTestExtension with plain JUnit 5. The memory-layout axis is now a method parameter: layout-dependent tests are @ParameterizedTest over @EnumSource(Mode.class) and build strings through a static fromString(Mode, String).
  • Layout-independent tests are now plain @Test (run once) instead of running four identical times. This includes the two binary-row blocks previously nested inside the numeric and decimal tests, which never used the layout helper.
  • Grouped tests into @Nested classes by concern: Basics, Comparison, Search, Manipulation, Conversion, Encoding.
  • Moved the string-to-decimal cases into a shared list fed to a @MethodSource, so each case is its own reported invocation.
  • Split the two oversized methods: the numeric test into integral / approximate-special-value / binary-row tests, and the decimal test into string / binary-row tests.

Verifying this change

This change is test-only and is verified by the tests themselves. The full class passes (279 invocations across the six nested groups, 0 failures). No assertions were dropped: every prior scenario maps forward, and the 49 decimal cases are unchanged.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Opus 4.8

Rework BinaryStringDataTest to plain JUnit 5 instead of the custom ParameterizedTestExtension. The memory-layout axis is now a method-level parameter: layout-dependent tests are @ParameterizedTest over @EnumSource(Mode.class) and build their strings through a static fromString(Mode, String), while layout-independent tests become plain @test instead of running four identical times.

Tests are grouped into @nested classes by concern (Basics, Comparison, Search, Manipulation, Conversion, Encoding). The string-to-decimal cases move to a shared list fed to a @MethodSource, so each case is now its own reported invocation. The two oversized methods are split into focused tests: the numeric method into integral, approximate-special-value and binary-row tests, and the decimal method into string and binary-row tests.

No assertions are dropped. Every prior scenario maps forward and the full class passes.
@raminqaf
raminqaf force-pushed the FLINK-40207-junit5-tests branch from 73bdd40 to a066399 Compare August 26, 2026 11:26
@flinkbot

flinkbot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Split toApproximateSpecialValues into separate parameterized tests for positive infinity, negative infinity, NaN and invalid input, each driven by a @MethodSource that crosses the modes with the input strings. Turn skipWrongFirstByte into a @valuesource test and testDecodeWithIllegalUtf8Bytes into a @MethodSource test over the decode entry points, so each case is its own invocation instead of a loop.
Turn the remaining loop-based binary-row decimal test into a @MethodSource parameterized test. Each case writes a single-column BinaryRowData, reads it back and asserts, so every decimal string is its own invocation instead of two loops over a shared row.
@raminqaf
raminqaf force-pushed the FLINK-40207-junit5-tests branch from cfc9920 to a51709f Compare August 28, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants