toil.test.wdl.wdltoil_test_kubernetes¶
Classes¶
A common base class for Toil tests. |
|
Ensure WDL works on the Kubernetes batchsystem. |
Functions¶
|
Find and instantiate the appropriate provisioner instance to make clusters in the given cloud. |
|
Use this decorator to identify tests that are slow and not critical. |
|
Use this to decorate integration tests so as to skip them during regular builds. |
Module Contents¶
- class toil.test.wdl.wdltoil_test_kubernetes.AbstractClusterTest(methodName)¶
Bases:
toil.test.ToilTestA common base class for Toil tests.
Please have every test case directly or indirectly inherit this one.
When running tests you may optionally set the TOIL_TEST_TEMP environment variable to the path of a directory where you want temporary test files be placed. The directory will be created if it doesn’t exist. The path may be relative in which case it will be assumed to be relative to the project root. If TOIL_TEST_TEMP is not defined, temporary files and directories will be created in the system’s default location for such files and any temporary files or directories left over from tests will be removed automatically removed during tear down. Otherwise, left-over files will not be removed.
- Parameters:
methodName (str)
- destroyCluster()¶
Destroy the cluster we built, if it exists.
Succeeds if the cluster does not currently exist.
- Return type:
None
- setUp()¶
Set up for the test. Must be overridden to call this method and set self.jobStore.
- Return type:
None
- tearDown()¶
Hook method for deconstructing the test fixture after testing it.
- Return type:
None
- sshUtil(command)¶
Run the given command on the cluster. Raise subprocess.CalledProcessError if it fails.
- Parameters:
command (List[str])
- Return type:
None
- rsync_util(from_file, to_file)¶
Transfer a file to/from the cluster.
The cluster-side path should have a ‘:’ in front of it.
- launchCluster()¶
- Return type:
None
- toil.test.wdl.wdltoil_test_kubernetes.cluster_factory(provisioner, clusterName=None, clusterType='mesos', zone=None, nodeStorage=50, nodeStorageOverrides=None, sseKey=None, enable_fuse=False)¶
Find and instantiate the appropriate provisioner instance to make clusters in the given cloud.
Raises ClusterTypeNotSupportedException if the given provisioner does not implement clusters of the given type.
- Parameters:
provisioner (str) – The cloud type of the cluster.
clusterName (Optional[str]) – The name of the cluster.
clusterType (str) – The type of cluster: ‘mesos’ or ‘kubernetes’.
zone (Optional[str]) – The cloud zone
nodeStorage (int)
nodeStorageOverrides (Optional[List[str]])
sseKey (Optional[str])
enable_fuse (bool)
- Returns:
A cluster object for the the cloud type.
- Return type:
Union[aws.awsProvisioner.AWSProvisioner, gceProvisioner.GCEProvisioner]
- toil.test.wdl.wdltoil_test_kubernetes.slow(test_item)¶
Use this decorator to identify tests that are slow and not critical. Skip if TOIL_TEST_QUICK is true.
- Parameters:
test_item (MT)
- Return type:
MT
- toil.test.wdl.wdltoil_test_kubernetes.integrative(test_item)¶
Use this to decorate integration tests so as to skip them during regular builds.
We define integration tests as A) involving other, non-Toil software components that we develop and/or B) having a higher cost (time or money).
- Parameters:
test_item (MT)
- Return type:
MT
- class toil.test.wdl.wdltoil_test_kubernetes.WDLKubernetesClusterTest(name)¶
Bases:
toil.test.provisioners.clusterTest.AbstractClusterTestEnsure WDL works on the Kubernetes batchsystem.
- setUp()¶
Set up for the test. Must be overridden to call this method and set self.jobStore.
- Return type:
None
- launchCluster()¶
- Return type:
None
- test_wdl_kubernetes_cluster()¶
Test that a wdl workflow works on a kubernetes cluster. Launches a cluster with 1 worker. This runs a wdl workflow that performs an image pull on the worker. :return: