import "github.com/apache/beam/sdks/go/pkg/beam/testing/ptest"
Package ptest contains utilities for pipeline unit testing.
var ( // expansionAddr is the endpoint for an expansion service for cross-language // transforms. ExpansionAddr = flag.String("expansion_addr", "", "Address of Expansion Service") )
Runner is a flag that sets which runner pipelines under test will use.
The test file must have a TestMain that calls Main or MainWithDefault to function.
Create creates a pipeline and a PCollection with the given values.
func Create2(a, b []interface{}) (*beam.Pipeline, beam.Scope, beam.PCollection, beam.PCollection)
Create2 creates a pipeline and 2 PCollections with the given values.
CreateList creates a pipeline and a PCollection with the given values.
func CreateList2(a, b interface{}) (*beam.Pipeline, beam.Scope, beam.PCollection, beam.PCollection)
CreateList2 creates a pipeline and 2 PCollections with the given values.
Main is an implementation of testing's TestMain to permit testing pipelines on runners other than the direct runner.
To enable this behavior, _ import the desired runner, and set the flag accordingly.
func TestMain(m *testing.M) { ptest.Main(m) }
MainWithDefault is an implementation of testing's TestMain to permit testing pipelines on runners other than the direct runner, while setting the default runner to use.
Run runs a pipeline for testing. The semantics of the pipeline is expected to be verified through passert.
RunAndValidate runs a pipeline for testing and validates the result, failing the test if the pipeline fails.
Package ptest imports 9 packages (graph) and is imported by 1 packages. Updated 2021-01-07. Refresh now. Tools for package owners.