toil.test.provisioners.gceProvisionerTest¶
Attributes¶
Classes¶
A common base class for Toil tests. |
|
A common base class for Toil tests. |
|
A common base class for Toil tests. |
|
Runs the tests on a statically provisioned cluster with autoscaling enabled. |
|
A common base class for Toil tests. |
|
This test insures autoscaling works on a restarted Toil run |
Functions¶
|
Use this to decorate integration tests so as to skip them during regular builds. |
|
Use as a decorator before test classes or methods to only run them if |
|
Use as a decorator before test classes or methods to run only if we have a Google Cloud project set. |
|
Use as a decorator before test classes or methods to run only if Google |
|
Use this decorator to identify tests that are slow and not critical. |
|
Use to limit the execution time of a function. |
Module Contents¶
- class toil.test.provisioners.gceProvisionerTest.ToilTest(methodName='runTest')[source]¶
Bases:
unittest.TestCaseA 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.
- classmethod setUpClass()[source]¶
Hook method for setting up class fixture before running tests in the class.
- Return type:
None
- classmethod tearDownClass()[source]¶
Hook method for deconstructing the class fixture after running all tests in the class.
- Return type:
None
- setUp()[source]¶
Hook method for setting up the test fixture before exercising it.
- Return type:
None
- toil.test.provisioners.gceProvisionerTest.integrative(test_item)[source]¶
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
- toil.test.provisioners.gceProvisionerTest.needs_fetchable_appliance(test_item)[source]¶
Use as a decorator before test classes or methods to only run them if the Toil appliance Docker image is able to be downloaded from the Internet.
- Parameters:
test_item (MT)
- Return type:
MT
- toil.test.provisioners.gceProvisionerTest.needs_google_project(test_item)[source]¶
Use as a decorator before test classes or methods to run only if we have a Google Cloud project set.
- Parameters:
test_item (MT)
- Return type:
MT
- toil.test.provisioners.gceProvisionerTest.needs_google_storage(test_item)[source]¶
Use as a decorator before test classes or methods to run only if Google Cloud is installed and we ought to be able to access public Google Storage URIs.
- Parameters:
test_item (MT)
- Return type:
MT
- toil.test.provisioners.gceProvisionerTest.slow(test_item)[source]¶
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.provisioners.gceProvisionerTest.timeLimit(seconds)[source]¶
Use to limit the execution time of a function.
Raises an exception if the execution of the function takes more than the specified amount of time. See <http://stackoverflow.com/a/601168>.
- Parameters:
seconds (int) – maximum allowable time, in seconds
- Return type:
Generator[None, None, None]
>>> import time >>> with timeLimit(2): ... time.sleep(1) >>> import time >>> with timeLimit(1): ... time.sleep(2) Traceback (most recent call last): ... RuntimeError: Timed out
- toil.test.provisioners.gceProvisionerTest.exactPython = 'python3.9'¶
- class toil.test.provisioners.gceProvisionerTest.AbstractGCEAutoscaleTest(methodName)[source]¶
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.
- projectID¶
- class toil.test.provisioners.gceProvisionerTest.GCEAutoscaleTest(name)[source]¶
Bases:
AbstractGCEAutoscaleTestA 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.
- class toil.test.provisioners.gceProvisionerTest.GCEStaticAutoscaleTest(name)[source]¶
Bases:
GCEAutoscaleTestRuns the tests on a statically provisioned cluster with autoscaling enabled.
- class toil.test.provisioners.gceProvisionerTest.GCEAutoscaleTestMultipleNodeTypes(name)[source]¶
Bases:
AbstractGCEAutoscaleTestA 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.