Repository navigation
Pilot @ObjectSource/@TableSource migration across all three phases - #291
Merged
Merged
Conversation
…ses (#271) Migrates one representative file per phase to validate the pattern end-to-end before scaling to the full 36-file effort. - Phase 1: PerCellTTLTest @CsvSource (14 rows) -> @TableSource (14 rows) - Phase 2: AliasSerializationTest @test -> @ObjectSource (2 -> 2) - Phase 3: MetadataStatusTest @test -> @TableSource (3 -> 6) Also fixes ObjectSourceParameterResolver.supportsParameter so it only resolves parameters of the test method itself. Previously it matched any parameter whose index fit within parameterNames.size, which competed with class-level extensions (HBaseTestingClusterExtension's Table injection in PerCellTTLTest's constructor) and raised ParameterResolutionException. With the guard, extension-injected test classes can now adopt @ObjectSource and @TableSource. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
3 tasks done
…tion-naming ktlint standard:function-naming rejects backtick-named functions in files that lack any test annotation imports (@test / @nested). V3NameValidatorTest and TableSourceTest pass because each imports @nested or @test; the new MetadataStatusTest had no such import, so spotlessKotlinCheck failed on CI. Wrapping the method in a @nested MatchesTest brings @nested into scope and matches the convention used elsewhere in this package. Test count unchanged (6 invocations). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replace double quotes with single quotes for cells that need quoting (the operations column, where commas would otherwise split flow elements), and unquote the name column entirely (no flow indicators in those values). Single quotes are literal — no escape interpretation — which suits test data better than double quotes' escape semantics. Test count and behavior unchanged (14/14 pass). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The (indentSize=2, lineLengthLimit=80) configuration is repeated in 9 test files (8 Serialization tests + 1 PrettyObjectWriterTest). Promote it to a companion-object constant so callers can write `PrettyObjectWriter.DEFAULT` instead of re-instantiating with the same numbers. Applied to AliasSerializationTest only as part of the Phase 0 pilot. The remaining 8 call sites will switch over when Phase 2 migrates them to @ObjectSource (#271). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous comment named a specific caller (HBaseTestingClusterExtension) and restated what the guard does. Per coding-style.md, comments should explain WHY when non-obvious — neither applies here: the code reads cleanly on its own, and the bug context belongs in the PR description, not the source. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
Author
|
Reviewed. Merging. |
1 task done
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.
Summary
Phase 0 pilot — migrates one Kotlin test per phase to validate the
@ObjectSource/@TableSourcepattern end-to-end before scaling. Picking one file per phase surfaces concerns specific to each shape early:@CsvSourcedensity preservation (Phase 1),@Testconsolidation under@ObjectSource(Phase 2), and primitive-matrix@TableSource(Phase 3).Part of #271.
Changes
engine/.../experiments/hbase/PerCellTTLTest.kt—@CsvSource(14 rows) →@TableSource(14 rows). Single-quoted YAML for cells with commas;~for null cells.core/.../metadata/AliasSerializationTest.kt— 2×@Test→ 2×@ObjectSource. Test count preserved (2 → 2). Also adoptsPrettyObjectWriter.DEFAULT(new companion-object constant for the(indentSize=2, lineLengthLimit=80)preset that 9 test files repeat).server/.../v3/metadata/MetadataStatusTest.kt— 3×@Test→ 1×@TableSourcewrapped in@Nested MatchesTest(3 → 6 invocations; the wrapping brings@Nestedinto scope so ktlint'sfunction-namingrule accepts the backtick-quoted method name).core/src/testFixtures/.../params/ObjectSourceParameterResolver.kt—supportsParameternow gates onparameterContext.declaringExecutable == testMethod. Previously it matched any parameter whose index fit withinparameterNames.size, which competed with class-level extensions for constructor parameters (HBaseTestingClusterExtension'sTableinjection inPerCellTTLTest→ParameterResolutionException). Surfaced by the Phase 1 pilot. Unblocks any extension-injected test class (HBase, Spring, …) from adopting@ObjectSource/@TableSource.After this PR,
rg "@CsvSource|@ValueSource" core engine server(Kotlin paths) drops by one file. 35 Kotlin files remain across Phases 1–3 (Phase 1: 8 → 7, Phase 2: 17 → 16, Phase 3: 11 → 10).How to Test
AI Assistance