schrodinger.seam.testing.stateful module¶
Hypothesis Stateful tests for Beam pipelines using random core transforms. Useful for stress testing the SeamRunner with a large variety of pipelines.
Can be used in two ways.
Run as a standalone script:
$SCHRODINGER/run python3 -m schrodinger.seam.testing.stateful --max-examples 1000 --stateful-step-count 10
Decorate a class with the StatefulBeamPipelineMachineTestCase decorator:
@StatefulBeamPipelineMachineTestCase class TestSeamRunnerStateful: pass
- class schrodinger.seam.testing.stateful.StatefulBeamPipelineMachine¶
 Bases:
hypothesis.stateful.RuleBasedStateMachineStateful test that builds up a Beam pipeline and then runs it with Seam at teardown.
Currently uses only numeric pcollections to keep the logic simple.
- pcolls = Bundle(name='pcolls')¶
 
- __init__()¶
 
- runPipeline()¶
 
- teardown()¶
 Called after a run has finished executing to clean up any necessary state.
Does nothing by default.
- applyCreate(new_elements: List[int])¶
 
- applySideInput(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyTop(pcoll: apache_beam.pvalue.PCollection)¶
 
- applySample(pcoll: apache_beam.pvalue.PCollection)¶
 
- filterAll(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyReshuffle(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyDistinct(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyFlatten(pcolls: List[apache_beam.pvalue.PCollection])¶
 
- applyMap(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyFlatMap(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyCount(pcoll: apache_beam.pvalue.PCollection)¶
 
- applySum(pcoll: apache_beam.pvalue.PCollection)¶
 
- applyGBK(pcoll: apache_beam.pvalue.PCollection)¶
 
- TestCase¶
 alias of
hypothesis.stateful.StatefulBeamPipelineMachine.TestCase
- bundle(name)¶
 
- check_invariants()¶
 
- classmethod initialize_rules()¶
 
- classmethod invariants()¶
 
- classmethod rules()¶
 
- schrodinger.seam.testing.stateful.StatefulBeamPipelineMachineTestCase(hypothesis_settings: Optional[hypothesis.settings] = None)¶
 Decorator to turn a class into a StatefulBeamPipelineMachine test case.
Example usage:
@StatefulBeamPipelineMachineTestCase class TestSeamRunnerStateful: pass