Skip to content

Port ReadSpannerSchemaTest off deprecated DoFnTester - #40921

Open
Supersaiyan101 wants to merge 2 commits into
apache:masterfrom
Supersaiyan101:port-spanner-dofntester
Open

Supersaiyan101 wants to merge 2 commits into
apache:masterfrom
Supersaiyan101:port-spanner-dofntester

Conversation

@Supersaiyan101

Copy link
Copy Markdown
Contributor

This PR ports ReadSpannerSchemaTest in sdks/java/io/google-cloud-platform off of the deprecated DoFnTester:

  • Modernized simple() and pgSimple() to run end-to-end within TestPipeline.
  • Used ParDo.of(new ReadSpannerSchema(config, dialectView)).withSideInputs(dialectView) on Create.of((Void) null) rather than manually passing side inputs to DoFnTester.
  • Used PAssert.that(schemas).satisfies(...) for asserting schema table, column, and primary key correctness.
  • Assigned explicit transform names ("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.

@github-actions github-actions Bot added java io gcp size/s S: 10-49 lines changed labels Oct 31, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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 Lists from 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.

@Supersaiyan101

Copy link
Copy Markdown
Contributor Author

/gemini review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Abacn for label java.
Backup reviewer: kennknowles (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant