toil.test.batchSystems.test_slurm

Classes

FakeBatchSystem

Class that implements a minimal Batch System, needed to create a Worker (see below).

SlurmTest

Class for unit-testing SlurmBatchSystem

Functions

call_sacct(args, **_)

The arguments passed to call_command when executing sacct are:

call_scontrol(args, **_)

The arguments passed to call_command when executing scontrol are:

call_sacct_raises(*_)

Fake that the sacct command fails by raising a CalledProcessErrorStderr

Module Contents

toil.test.batchSystems.test_slurm.call_sacct(args, **_)[source]

The arguments passed to call_command when executing sacct are: [‘sacct’, ‘-n’, ‘-j’, ‘<comma-separated list of job-ids>’, ‘–format’, ‘JobIDRaw,State,ExitCode’, ‘-P’, ‘-S’, ‘1970-01-01’] The multi-line output is something like:

1234|COMPLETED|0:0
1234.batch|COMPLETED|0:0
1235|PENDING|0:0
1236|FAILED|0:2
1236.extern|COMPLETED|0:0
Return type:

str

toil.test.batchSystems.test_slurm.call_scontrol(args, **_)[source]

The arguments passed to call_command when executing scontrol are: ['scontrol', 'show', 'job'] or ['scontrol', 'show', 'job', '<job-id>']

Return type:

str

toil.test.batchSystems.test_slurm.call_sacct_raises(*_)[source]

Fake that the sacct command fails by raising a CalledProcessErrorStderr

class toil.test.batchSystems.test_slurm.FakeBatchSystem[source]

Class that implements a minimal Batch System, needed to create a Worker (see below).

getWaitDuration()[source]
class toil.test.batchSystems.test_slurm.SlurmTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Class for unit-testing SlurmBatchSystem

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_getJobDetailsFromSacct_one_exists()[source]
test_getJobDetailsFromSacct_one_not_exists()[source]
test_getJobDetailsFromSacct_many_all_exist()[source]
test_getJobDetailsFromSacct_many_some_exist()[source]
test_getJobDetailsFromSacct_many_none_exist()[source]
test_getJobDetailsFromScontrol_one_exists()[source]
test_getJobDetailsFromScontrol_one_not_exists()[source]

Asking for the job details of a single job that scontrol doesn’t know about should raise an exception.

test_getJobDetailsFromScontrol_many_all_exist()[source]
test_getJobDetailsFromScontrol_many_some_exist()[source]
test_getJobDetailsFromScontrol_many_none_exist()[source]
test_getJobExitCode_job_exists()[source]
test_getJobExitCode_job_not_exists()[source]
test_getJobExitCode_sacct_raises_job_exists()[source]

This test forces the use of scontrol to get job information, by letting sacct raise an exception.

test_getJobExitCode_sacct_raises_job_not_exists()[source]

This test forces the use of scontrol to get job information, by letting sacct raise an exception. Next, scontrol should also raise because it doesn’t know the job.

test_coalesce_job_exit_codes_one_exists()[source]
test_coalesce_job_exit_codes_one_not_exists()[source]
test_coalesce_job_exit_codes_many_all_exist()[source]
test_coalesce_job_exit_codes_some_exists()[source]
test_coalesce_job_exit_codes_sacct_raises_job_exists()[source]

This test forces the use of scontrol to get job information, by letting sacct raise an exception.

test_coalesce_job_exit_codes_sacct_raises_job_not_exists()[source]

This test forces the use of scontrol to get job information, by letting sacct raise an exception. Next, scontrol should also raise because it doesn’t know the job.