Rishavbhattarai opened a new pull request, #40866:
URL: https://github.com/apache/beam/pull/40866

   Fixes #18692.
   
   Ports `DatastoreV1Test` off the deprecated `DoFnTester`.
   
   `TestPipeline` doesn't fit here. `DatastoreWriterFn`, `SplitQueryFn` and 
`ReadFn` get their client from `mockDatastoreFactory`, a Mockito mock that 
can't be serialized, and the tests verify calls on that mock after the bundle. 
That's why every `DoFnTester` call used `CloningBehavior.DO_NOT_CLONE`.
   
   So I added one helper to the test, `processBundle(fn, inputs)`. It runs the 
fn in-process through `DoFnRunners.simpleRunner` (start bundle, process each 
input in the global window, finish bundle) and returns the main outputs. The 10 
call sites now call it, and the comments about disabling cloning are gone since 
nothing gets cloned. `:runners:core-java` is already an `implementation` 
dependency of this module, so there's no build change.
   
   Testing: `./gradlew :sdks:java:io:google-cloud-platform:test --tests 
'org.apache.beam.sdk.io.gcp.datastore.DatastoreV1Test*'` passes (62/62 across 
`SingletonTests` and `ParameterizedTests`), and `spotlessCheck` is clean.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to