Skip to content

Migrate core data-driven tests to @ObjectSource/@TableSource - #295

Merged
em3s merged 1 commit into
mainfrom
chore/test-migration-phase-2
Apr 28, 2026
Merged

em3s merged 1 commit into
mainfrom
chore/test-migration-phase-2

Conversation

@em3s

@em3s em3s commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of #271. Migrate the genuinely data-driven core tests; document why six files stay as @Test.

Refs #271

Changes

  • Migrated: 8 SerializationTests (Database, Datastore, Table, EdgeSchema, V2Alias, V2Label, V2Service, V2Storage) + AliasSerializationTest pilot reformatted; EdgeMutationStrategyTest (15 → 15, 4 @Nested matrices → 4 @TableSource); PrettyObjectWriterTest sort=true/false pairs only.
  • Conventions: JSON-flow YAML for descriptor / expected objects (they travel as JSON); PrettyObjectWriter.DEFAULT replaces the repeated constructor (Pilot @ObjectSource/@TableSource migration across all three phases #291 finding); pipe rows containing : are single-quoted to keep YAML from reading them as flow mappings.
  • Kept as @Test (added to Migrate Kotlin data-driven tests to @ObjectSource #271 with reasons): KotlinCoreJvmRuntimeTest, ApiTestExtensionsTest, EdgeBulkMutationRequestTest (single-scenario, not data-driven); EdgeMutationBuilderTest, EdgeCacheRecordMapperTest, V2MultiEdgeBulkLoadTest (heterogeneous assertion shapes per case).

How to Test

./gradlew :core:test
./gradlew spotlessKotlinCheck

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code with Claude Opus 4.7 (1M context)

…o data-driven family

Phase 2 of #271, scoped to genuinely data-driven tests in core. Files where
each @test was a unique scenario (single-shape, structured fixtures) are
deliberately left as @test — forcing them into @ObjectSource adds string
dispatch without revealing intent.

Migrated:
  - 8 SerializationTests (Database, Datastore, Table, EdgeSchema, V2Alias,
    V2Label, V2Service, V2Storage) — symmetric serialize / deserialize pairs
    plus a few V2-to-V3 conversion variants. Test counts preserved per file.
  - AliasSerializationTest pilot updated for consistency with the others.
  - EdgeMutationStrategyTest — 4 @nested matrices (DirectedSource,
    DirectedTarget, CountRecordOnDelete, CountRecordsOnUpdate) collapse
    to one @TableSource each; 2x2/4x1 layouts surface the design contract
    side-by-side. 15 to 15 cases.
  - PrettyObjectWriterTest — only the sort=true/false pairs (4 to 2 methods,
    same case count); the rest stay as @test (heterogeneous writer configs
    or one-off scenarios).

Conventions adopted in this batch:
  - JSON-flow YAML for descriptor/expected objects (curly-brace flow style
    embedded in YAML), since these descriptors travel as JSON over HTTP.
  - PrettyObjectWriter.DEFAULT in place of the repeated
    PrettyObjectWriter(indentSize = 2, lineLengthLimit = 80) constructor
    (per #291 Phase 0 findings).
  - Pipe rows whose cells contain colons are wrapped in single-quoted YAML
    scalars so the YAML parser does not read them as flow mappings.

Skipped (added to "Out of scope (this PR)" with reasons):
  - 3 single-@test scenarios (KotlinCoreJvmRuntimeTest, ApiTestExtensionsTest,
    EdgeBulkMutationRequestTest) — not data-driven.
  - 3 multi-@test files (EdgeMutationBuilderTest, EdgeCacheRecordMapperTest,
    V2MultiEdgeBulkLoadTest) — heterogeneous assertion shapes per case.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. maintenance Maintenance work. labels Apr 28, 2026
@em3s em3s changed the title Migrate Phase 2 core data-driven tests to @ObjectSource/@TableSource Migrate core data-driven tests to @ObjectSource/@TableSource Apr 28, 2026
@em3s
em3s merged commit c4f1f5a into main Apr 28, 2026
7 checks passed
@em3s
em3s deleted the chore/test-migration-phase-2 branch April 28, 2026 14:37
@em3s em3s self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance work. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant