Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-3650 Deprecate and remove DoFnTester
  3. BEAM-3159

DoFnTester should be deprecated in favor of TestPipeline

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0
    • Component/s: sdk-java-core
    • Labels:
      None

      Description

      Reasons:

      1. The logical unit within a Beam pipeline is a transform. Either a small transform like a ParDo or a larger composite transform. Unit tests should focus on these units, rather than probing specific behaviors of the user-defined functions.

      2. The way that a runner interacts with a user-defined function is not necessarily obvious. DoFnTester allows testing non-sensical cases that wouldn't arise in practice, since it allows low-level interactions with the actual UDFs.

      Instead, we should encourage the use of TestPipeline with the direct runner. This allows testing a single transform (such as a ParDo running a UDF) in context. It also makes it easier to test things like side-inputs and multiple outputs, since you use the same techniques in the test as you would in a real pipeline, rather than requiring a whole new API.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kenn Kenneth Knowles
                Reporter:
                bchambers Ben Chambers
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m