toil.test.lib.dockerTest¶
Attributes¶
Classes¶
Tests dockerCall and ensures no containers are left around. |
Module Contents¶
- toil.test.lib.dockerTest.logger¶
- class toil.test.lib.dockerTest.DockerTest(methodName='runTest')[source]¶
Bases:
toil.test.ToilTest
Tests dockerCall and ensures no containers are left around. 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.
- testDockerClean(caching=False, detached=True, rm=True, deferParam=None)[source]¶
Run the test container that creates a file in the work dir, and sleeps for 5 minutes. Ensure that the calling job gets SIGKILLed after a minute, leaving behind the spooky/ghost/zombie container. Ensure that the container is killed on batch system shutdown (through the deferParam mechanism).
- testDockerPipeChain(caching=False)[source]¶
Test for piping API for dockerCall(). Using this API (activated when list of argument lists is given as parameters), commands a piped together into a chain. ex:
parameters=[ ['printf', 'x\n y\n'], ['wc', '-l'] ]
should execute:printf 'x\n y\n' | wc -l
- testDockerPipeChainErrorDetection(caching=False)[source]¶
By default, executing cmd1 | cmd2 | … | cmdN, will only return an error if cmdN fails. This can lead to all manor of errors being silently missed. This tests to make sure that the piping API for dockerCall() throws an exception if non-last commands in the chain fail.