Repository navigation
Migrate Phase 1 already-parameterized tests to @TableSource - #292
Merged
Merged
Conversation
3 tasks done
1 task done
em3s
force-pushed
the
chore/test-migration-phase-1
branch
from
April 28, 2026 07:27
2bdcd4c to
e96f213
Compare
em3s
force-pushed
the
chore/test-migration-phase-1
branch
3 times, most recently
from
April 28, 2026 07:39
034f92b to
33e8971
Compare
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]>
…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]>
…ource format Replaces remaining @CsvSource annotations in these test files with the updated @TableSource pipe-delimited row format to align with prior migrations (#271).
em3s
force-pushed
the
chore/test-migration-phase-1
branch
from
April 28, 2026 07:53
4c4a59f to
15b5570
Compare
Two coupled changes: 1. ObjectSourceExtension.parseRow keeps pipe-row cells as raw String (only `~` is special-cased to null). Per-cell YAML scalar parsing was over-eager: cells like `[1, 2]` parsed to List, then convertValue to String target failed. Letting Jackson's resolver handle String → target coercion at parameter-resolution time covers all cases (Int, Long, Boolean, enum, String) without breaking quoted-list cells. 2. CombinatoricsTest converts from flow rows (quoted-list cells inside flow lists) to pipe rows with aligned column headers as comments. parseAsList still does the work in test bodies; cells stay String end-to-end. Test counts unchanged: Combinatorics 45/45, SingleTransition 41/41, ProcessingOrder 44/44, TableSourceTest 12/12, codec tests 4/4 + 6/6. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
force-pushed
the
chore/test-migration-phase-1
branch
from
April 28, 2026 08:04
15b5570 to
8c14303
Compare
Pipe-row cells are now raw String after parser simplification in 8c14303 (no per-cell YAML scalar parsing), so '3' was being kept as the literal "'3'". The expected param is String?, so a bare 3 round-trips correctly and matches Bytes.toLong(...).toString() = "3". 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
Phase 1 of #271: migrate Kotlin already-parameterized tests from
@CsvSourceto@TableSource, and keep pipe-row cells as rawStringso flow-list cells survive the round trip.Refs #271
Changes
@CsvSource→@TableSource(test counts preserved):ProcessingOrderTest(44×14),SingleTransitionTest(41×32),CombinatoricsTest(45),EdgeIndexMapperTest(4),EdgeCountMapperTest(6); plus annotation-order tidy inEdgeStateMapperTestand a small pilot follow-up inPerCellTTLTest.ObjectSourceExtension.parseRow: pipe cells stay as rawString(only~→null). Per-cell YAML parsing previously over-typed flow-list cells like[1, 2]; Jackson coerces at parameter-resolution time anyway. KDoc onTableSourceupdated; literal~string is no longer expressible in pipe form (use flow row).ComplexTransitionTestandReadOnlyRequestFilterTestkeep@MethodSourceas the documented escape hatch (runtime cartesian / reflection-scanned endpoints) — no change.How to Test
AI Assistance