Repository navigation
Port BatchViewOverridesTest off DoFnTester - #41202
jrmccluskey merged 1 commit into
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly migrates BatchViewOverridesTest away from the deprecated DoFnTester by introducing a local processBundle helper backed by DoFnRunners.simpleRunner. Because the tested DoFns rely on deterministic within-bundle ordering and bundle-scoped index counters, running single bundles directly via DoFnRunners.simpleRunner is an appropriate choice over TestPipeline.
🔍 General Feedback
- The
BundleOutputshelper andWindowedValueMultiReceivercleanly handle both main and side outputs (outputForSizeTagandoutputForEntrySetTag). - Unwrapping
UserCodeExceptionviaThrowables.throwIfUnchecked(e.getCause())preserves the exact exception assertions for the negative test cases. - All 10 existing test cases and their assertions are faithfully preserved.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
These DoFns number their output by position within a bundle, and the tests assert those positions, so they need one bundle with a known input order. TestPipeline does not guarantee that, so the tests now run each fn in-process through DoFnRunners.simpleRunner via a small processBundle helper, the same approach as the DatastoreV1Test port. The helper collects outputs per tag, for the map-like fn's side outputs, and unwraps UserCodeException so the two exception tests keep expecting the fn's own IllegalStateException. Fixes apache#18693
3713ec0 to
ffbac04
Compare
|
Assigning reviewers: R: @jrmccluskey added as fallback since no labels match configuration 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). |
Fixes #18693.
Ports
BatchViewOverridesTestoff the deprecatedDoFnTester.TestPipelinedoesn't fit here. These DoFns number their output by position within a bundle (ToIsmRecordForGlobalWindowDoFncounts elements, the map-like and metadata fns count per window), and the tests assert those exact positions and their order. That needs one bundle with a known input order, which a pipeline doesn't guarantee.So, like the
DatastoreV1Testport (#40866), the test gets aprocessBundlehelper that runs the fn in-process throughDoFnRunners.simpleRunner. Two additions over that helper:ToIsmRecordForMapLikeDoFnalso writes the size and entry-set side outputs thattestToIsmRecordForMapLikeDoFnchecks;UserCodeException, so the two exception tests still expect the fn's ownIllegalStateExceptionand message.The assertions themselves are unchanged.
:runners:google-cloud-dataflow-java:test --tests BatchViewOverridesTestpasses (10/10), andspotlessApplyandcheckstyleTestare clean.Fixes #18693).CHANGES.md: not needed, test-only change.