Repository navigation
Add root-list and pipe-delimited row shapes to @TableSource - #293
Merged
Merged
Conversation
Replaces the previous map-with-`columns:`-and-`rows:` shape with a single
canonical form: the annotation value is a YAML list of rows. Cells map to
test method parameters by position via Kotlin reflection, so the redundant
`columns:` declaration is gone too.
Each row item is one of:
- **Flow list** `[a, b, c]` — concise for short tables (existing shape,
minus the wrapper).
- **Pipe-delimited string** `a | b | c` — recovers the column-by-column
scannability of the original @CsvSource for wide matrices. Each cell is
parsed as a YAML scalar (so `~` is null, bare numbers are typed,
single-quoted strings keep their content). YAML strips `#` comments and
blank lines naturally.
Example (state-machine style):
@TableSource("""
# state machine transitions
- IDLE | START | RUNNING
- RUNNING | STOP | IDLE
""")
fun `transition`(from: State, event: Event, expected: State) { ... }
`parseTableSource` now requires the test method's parameter names; the
extension supplies them from reflection.
Phase 0 callers updated to the new shape:
- engine/.../experiments/hbase/PerCellTTLTest.kt
- server/.../v3/metadata/MetadataStatusTest.kt
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
force-pushed
the
feat/tablesource-pipe-rows-and-root-list
branch
from
April 28, 2026 07:18
7f15e72 to
5af1fa8
Compare
em3s
added a commit
that referenced
this pull request
Apr 28, 2026
…rce (#271) Replaces all remaining @CsvSource usages in Kotlin test files with the new @TableSource shape introduced in #293 (root list, no `columns:` or `rows:` wrapper, pipe-delimited rows for wide matrices). - core/codec/EdgeIndexMapperTest.kt — leftover @CsvSource (2 rows) - core/codec/EdgeCountMapperTest.kt — leftover @CsvSource (1 row) - core/state/SingleTransitionTest.kt — 41 rows × 32 columns (pipe rows) - core/state/ProcessingOrderTest.kt — 44 rows × 14 columns (pipe rows) - test/state/CombinatoricsTest.kt — 8 @CsvSource blocks (flow rows; cells are quoted strings parsed by parseAsList) ComplexTransitionTest.kt and server/filter/ReadOnlyRequestFilterTest.kt remain on @MethodSource as escape hatches per the issue's guidance: cases are computed at runtime (cartesian products, reflection-scanned endpoints). Test bodies and helper calls (toBooleanFlexible, toEventType, toStateValue, handleSpecialValue, toEventSequence, parseAsList) kept as-is — those helpers do domain work beyond what Jackson can replace (runtime version context, special-marker semantics, notation parsing). Acceptance: `rg "@CsvSource|@valuesource" core engine server` Kotlin matches drops to 0. Test counts preserved per file: - EdgeIndexMapperTest 4 → 4 - EdgeCountMapperTest 6 → 6 - SingleTransitionTest 41 → 41 - ProcessingOrderTest 44 → 44 - CombinatoricsTest 45 → 45 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
Author
|
Reviewed. Merging |
em3s
added a commit
that referenced
this pull request
Apr 28, 2026
…rce (#271) Replaces all remaining @CsvSource usages in Kotlin test files with the new @TableSource shape introduced in #293 (root list, no `columns:` or `rows:` wrapper, pipe-delimited rows for wide matrices). - core/codec/EdgeIndexMapperTest.kt — leftover @CsvSource (2 rows) - core/codec/EdgeCountMapperTest.kt — leftover @CsvSource (1 row) - core/state/SingleTransitionTest.kt — 41 rows × 32 columns (pipe rows) - core/state/ProcessingOrderTest.kt — 44 rows × 14 columns (pipe rows) - test/state/CombinatoricsTest.kt — 8 @CsvSource blocks (flow rows; cells are quoted strings parsed by parseAsList) ComplexTransitionTest.kt and server/filter/ReadOnlyRequestFilterTest.kt remain on @MethodSource as escape hatches per the issue's guidance: cases are computed at runtime (cartesian products, reflection-scanned endpoints). Test bodies and helper calls (toBooleanFlexible, toEventType, toStateValue, handleSpecialValue, toEventSequence, parseAsList) kept as-is — those helpers do domain work beyond what Jackson can replace (runtime version context, special-marker semantics, notation parsing). Acceptance: `rg "@CsvSource|@valuesource" core engine server` Kotlin matches drops to 0. Test counts preserved per file: - EdgeIndexMapperTest 4 → 4 - EdgeCountMapperTest 6 → 6 - SingleTransitionTest 41 → 41 - ProcessingOrderTest 44 → 44 - CombinatoricsTest 45 → 45 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
added a commit
that referenced
this pull request
Apr 28, 2026
…rce (#271) Replaces all remaining @CsvSource usages in Kotlin test files with the new @TableSource shape introduced in #293 (root list, no `columns:` or `rows:` wrapper, pipe-delimited rows for wide matrices). - core/codec/EdgeIndexMapperTest.kt — leftover @CsvSource (2 rows) - core/codec/EdgeCountMapperTest.kt — leftover @CsvSource (1 row) - core/state/SingleTransitionTest.kt — 41 rows × 32 columns (pipe rows) - core/state/ProcessingOrderTest.kt — 44 rows × 14 columns (pipe rows) - test/state/CombinatoricsTest.kt — 8 @CsvSource blocks (flow rows; cells are quoted strings parsed by parseAsList) ComplexTransitionTest.kt and server/filter/ReadOnlyRequestFilterTest.kt remain on @MethodSource as escape hatches per the issue's guidance: cases are computed at runtime (cartesian products, reflection-scanned endpoints). Test bodies and helper calls (toBooleanFlexible, toEventType, toStateValue, handleSpecialValue, toEventSequence, parseAsList) kept as-is — those helpers do domain work beyond what Jackson can replace (runtime version context, special-marker semantics, notation parsing). Acceptance: `rg "@CsvSource|@valuesource" core engine server` Kotlin matches drops to 0. Test counts preserved per file: - EdgeIndexMapperTest 4 → 4 - EdgeCountMapperTest 6 → 6 - SingleTransitionTest 41 → 41 - ProcessingOrderTest 44 → 44 - CombinatoricsTest 45 → 45 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
added a commit
that referenced
this pull request
Apr 28, 2026
…rce (#271) Replaces all remaining @CsvSource usages in Kotlin test files with the new @TableSource shape introduced in #293 (root list, no `columns:` or `rows:` wrapper, pipe-delimited rows for wide matrices). - core/codec/EdgeIndexMapperTest.kt — leftover @CsvSource (2 rows) - core/codec/EdgeCountMapperTest.kt — leftover @CsvSource (1 row) - core/state/SingleTransitionTest.kt — 41 rows × 32 columns (pipe rows) - core/state/ProcessingOrderTest.kt — 44 rows × 14 columns (pipe rows) - test/state/CombinatoricsTest.kt — 8 @CsvSource blocks (flow rows; cells are quoted strings parsed by parseAsList) ComplexTransitionTest.kt and server/filter/ReadOnlyRequestFilterTest.kt remain on @MethodSource as escape hatches per the issue's guidance: cases are computed at runtime (cartesian products, reflection-scanned endpoints). Test bodies and helper calls (toBooleanFlexible, toEventType, toStateValue, handleSpecialValue, toEventSequence, parseAsList) kept as-is — those helpers do domain work beyond what Jackson can replace (runtime version context, special-marker semantics, notation parsing). Acceptance: `rg "@CsvSource|@valuesource" core engine server` Kotlin matches drops to 0. Test counts preserved per file: - EdgeIndexMapperTest 4 → 4 - EdgeCountMapperTest 6 → 6 - SingleTransitionTest 41 → 41 - ProcessingOrderTest 44 → 44 - CombinatoricsTest 45 → 45 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
added a commit
that referenced
this pull request
Apr 28, 2026
…rce (#271) Replaces all remaining @CsvSource usages in Kotlin test files with the new @TableSource shape introduced in #293 (root list, no `columns:` or `rows:` wrapper, pipe-delimited rows for wide matrices). - core/codec/EdgeIndexMapperTest.kt — leftover @CsvSource (2 rows) - core/codec/EdgeCountMapperTest.kt — leftover @CsvSource (1 row) - core/state/SingleTransitionTest.kt — 41 rows × 32 columns (pipe rows) - core/state/ProcessingOrderTest.kt — 44 rows × 14 columns (pipe rows) - test/state/CombinatoricsTest.kt — 8 @CsvSource blocks (flow rows; cells are quoted strings parsed by parseAsList) ComplexTransitionTest.kt and server/filter/ReadOnlyRequestFilterTest.kt remain on @MethodSource as escape hatches per the issue's guidance: cases are computed at runtime (cartesian products, reflection-scanned endpoints). Test bodies and helper calls (toBooleanFlexible, toEventType, toStateValue, handleSpecialValue, toEventSequence, parseAsList) kept as-is — those helpers do domain work beyond what Jackson can replace (runtime version context, special-marker semantics, notation parsing). Acceptance: `rg "@CsvSource|@valuesource" core engine server` Kotlin matches drops to 0. Test counts preserved per file: - EdgeIndexMapperTest 4 → 4 - EdgeCountMapperTest 6 → 6 - SingleTransitionTest 41 → 41 - ProcessingOrderTest 44 → 44 - CombinatoricsTest 45 → 45 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
Simplifies
@TableSourceto a single canonical shape: the annotation value is a YAML list of rows; cells map to test method parameters by position via Kotlin reflection. The previous map-with-columns:-and-rows:wrapper is removed —columns:was always redundant with the method signature, and therows:wrapper added a layer that didn't earn its keep.This is a precondition for the Phase 1 migration in #271 / #292: state-machine tests like
SingleTransitionTest(41 × 32) read poorly without column-by-column scannability.Changes
Each row item is one of two shapes:
1. Flow list
[a, b, c]— concise for short, simple tables.2. Pipe-delimited string
a | b | c— recommended for wide matrices where column-by-column scannability matters. Each cell is parsed as a YAML scalar, so~is null, bare numbers are typed, and single-quoted strings keep their content. YAML strips#comments and blank lines naturally.Implementation
core/src/testFixtures/.../params/ObjectSourceExtension.kt—parseTableSourcenow takesmethodParameters: List<String>(supplied from reflection at call time). The annotation value parses as a YAML list directly; each row item is dispatched toparseRowwhich handlesList(flow) orString(pipe).core/src/testFixtures/.../params/TableSource.kt— KDoc updated.core/src/test/.../test/TableSourceTest.kt— covers both shapes plus error paths.Phase 0 callers updated
The two callers that already used
@TableSourceare converted to the new shape:engine/.../experiments/hbase/PerCellTTLTest.kt(14 rows × 3 cols)server/.../v3/metadata/MetadataStatusTest.kt(6 rows × 3 cols)Both retain their original test counts.
Breaking change
The legacy map-with-
columns:-and-rows:shape no longer parses. Any consumer outside this PR that uses@TableSourcemust adopt the new shape; #292 (Phase 1 migration) will rebase on this PR.How to Test
AI Assistance