toil.test.cactus.test_cactus_integration

Classes

AbstractClusterTest

A common base class for Toil tests.

CactusIntegrationTest

Run the Cactus Integration test on a Kubernetes AWS cluster

Functions

cluster_factory(provisioner[, clusterName, ...])

Find and instantiate the appropriate provisioner instance to make clusters in the given cloud.

Module Contents

toil.test.cactus.test_cactus_integration.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]

class toil.test.cactus.test_cactus_integration.AbstractClusterTest(methodName)

Bases: toil.test.ToilTest

A 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)

python()

Return the full path to the venv Python on the leader.

Return type:

str

pip()

Return the full path to the venv pip on the leader.

Return type:

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.

Parameters:
  • from_file (str)

  • to_file (str)

Return type:

None

createClusterUtil(args=None)
Parameters:

args (Optional[List[str]])

Return type:

None

launchCluster()
Return type:

None

class toil.test.cactus.test_cactus_integration.CactusIntegrationTest(methodName)

Bases: toil.test.provisioners.clusterTest.AbstractClusterTest

Run the Cactus Integration test on a Kubernetes AWS cluster

setUp()

Set up for the test. Must be overridden to call this method and set self.jobStore.

test_cactus_integration()