toil.test.src.promisedRequirementTest

Module Contents

Classes

hidden

Hide abstract base class from unittest's test case loader.

SingleMachinePromisedRequirementsTest

Tests against the SingleMachine batch system

MesosPromisedRequirementsTest

Tests against the Mesos batch system

Functions

maxConcurrency(job, cpuCount, filename, coresPerJob)

Returns the max number of concurrent tasks when using a PromisedRequirement instance

getOne()

getThirtyTwoMb()

logDiskUsage(job, funcName[, sleep])

Logs the job's disk usage to master and sleeps for specified amount of time.

Attributes

log

toil.test.src.promisedRequirementTest.log
class toil.test.src.promisedRequirementTest.hidden

Hide abstract base class from unittest’s test case loader.

http://stackoverflow.com/questions/1323455/python-unit-test-with-base-and-sub-class#answer-25695512

class AbstractPromisedRequirementsTest

Bases: toil.test.batchSystems.batchSystemTest.hidden.AbstractBatchSystemJobTest

Inheritance diagram of toil.test.src.promisedRequirementTest.hidden.AbstractPromisedRequirementsTest

An abstract base class for testing Toil workflows with promised requirements.

testConcurrencyDynamic()

Asserts that promised core resources are allocated properly using a dynamic Toil workflow

testConcurrencyStatic()

Asserts that promised core resources are allocated properly using a static DAG

getOptions(tempDir, caching=True)
getCounterPath(tempDir)

Returns path to a counter file :param str tempDir: path to test directory :return: path to counter file

testPromisesWithJobStoreFileObjects(caching=True)

Check whether FileID objects are being pickled properly when used as return values of functions. Then ensure that lambdas of promised FileID objects can be used to describe the requirements of a subsequent job. This type of operation will be used commonly in Toil scripts. :return: None

testPromisesWithNonCachingFileStore()
testPromiseRequirementRaceStatic()

Checks for a race condition when using promised requirements and child job functions.

toil.test.src.promisedRequirementTest.maxConcurrency(job, cpuCount, filename, coresPerJob)

Returns the max number of concurrent tasks when using a PromisedRequirement instance to allocate the number of cores per job.

Parameters
  • cpuCount (int) – number of available cpus

  • filename (str) – path to counter file

  • coresPerJob (int) – number of cores assigned to each job

Return int max concurrency value

toil.test.src.promisedRequirementTest.getOne()
toil.test.src.promisedRequirementTest.getThirtyTwoMb()
toil.test.src.promisedRequirementTest.logDiskUsage(job, funcName, sleep=0)

Logs the job’s disk usage to master and sleeps for specified amount of time.

Returns

job function’s disk usage

class toil.test.src.promisedRequirementTest.SingleMachinePromisedRequirementsTest

Bases: hidden

Inheritance diagram of toil.test.src.promisedRequirementTest.SingleMachinePromisedRequirementsTest

Tests against the SingleMachine batch system

getBatchSystemName()
tearDown()
class toil.test.src.promisedRequirementTest.MesosPromisedRequirementsTest

Bases: hidden, toil.batchSystems.mesos.test.MesosTestSupport

Inheritance diagram of toil.test.src.promisedRequirementTest.MesosPromisedRequirementsTest

Tests against the Mesos batch system

getOptions(tempDir, caching=True)
getBatchSystemName()
tearDown()