Repository navigation
Port ReadSpannerSchemaTest off deprecated DoFnTester - #40921
Supersaiyan101 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly migrates ReadSpannerSchemaTest off the deprecated DoFnTester to execute end-to-end on TestPipeline using ParDo with side inputs and PAssert. The logic, transform naming, and assertions accurately preserve the original test coverage.
🔍 General Feedback
- Consider importing
Listsfrom the vendored Guava package (org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Lists) rather than using the fully-qualified class name inline in both test methods.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly migrates ReadSpannerSchemaTest off the deprecated DoFnTester to TestPipeline using ParDo with side inputs and PAssert. The pipeline structure, transform naming, and schema assertions accurately preserve the original test coverage.
🔍 General Feedback
- No issues found. The migration follows standard Beam testing idioms.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @Abacn for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
This PR ports
ReadSpannerSchemaTestinsdks/java/io/google-cloud-platformoff of the deprecatedDoFnTester:simple()andpgSimple()to run end-to-end withinTestPipeline.ParDo.of(new ReadSpannerSchema(config, dialectView)).withSideInputs(dialectView)onCreate.of((Void) null)rather than manually passing side inputs toDoFnTester.PAssert.that(schemas).satisfies(...)for asserting schema table, column, and primary key correctness."CreateDialect"and"CreateVoid") to ensure stable unique transform names in the pipeline graph.Verified with
./gradlew :sdks:java:io:google-cloud-platform:test --tests "org.apache.beam.sdk.io.gcp.spanner.ReadSpannerSchemaTest"(2/2 passed) and formatted with:sdks:java:io:google-cloud-platform:spotlessApply.