ensembl-hive-python3  2.7.0
eHive.tests Namespace Reference

Functions

def testRunnable (testcase, runnableClass, inputParameters, refEvents, config=None)
 Method to test a Runnable. More...
 

Variables

 WarningEvent = collections.namedtuple('WarningEvent', ['message', 'is_error'])
 
 DataflowEvent = collections.namedtuple('DataflowEvent', ['output_ids', 'branch_name_or_code'])
 
 CompleteEarlyEvent = collections.namedtuple('CompleteEarlyEvent', ['message'])
 
 FailureEvent = collections.namedtuple('FailureEvent', ['exception', 'args'])
 
 __config
 Helper class to provide a test-enabled version of the requested Runnable. More...
 
 __refEvents
 
 _BaseRunnable__params
 
 input_job
 
 debug
 
 __created_worker_temp_directory
 Run the job's life cycle. More...
 

Function Documentation

◆ testRunnable()

def eHive.tests.testRunnable (   testcase,
  runnableClass,
  inputParameters,
  refEvents,
  config = None 
)

Method to test a Runnable.

Parameters
testcaseinstance of unittest.TestCase, which is used to do the actual tests.
runnableClassRunnable being tested. Can be a string of the actual type.
inputParametersdictionary of input parameters. Will override the Runnable's param_defaults() dictionary.
refEventslist of "events" the Runnable is expected to raise (in the right order). Accepted events are
  • WarningEvent.
  • DataflowEvent.
  • CompleteEarlyEvent.
  • FailureEvent.
configextra configuration options, given as a dictionary. Accepted keys are
  • is_retry: bool or int, default False. whether the job is considered a retry (i.e. whether pre_cleanup should run).
  • no_write: bool, default False. whether write_output is skipped.
  • no_cleanup: bool, default False. whether the temporary directory is removed at the end of the run.
  • debug: int, default 0. the debug level.
  • test_autoflow: bool, default not set. when set, check that this is the final value of the job's autoflow attribute.
  • test_lethal_for_worker: bool, default not set. when set, check that this is the final value of the job's lethal_for_worker attribute.
  • test_transient_error: bool, default not set. when set, check that this is the final value of the job's lethal_for_worker attribute.

Definition at line 71 of file tests.py.

+ Here is the call graph for this function:

Variable Documentation

◆ __config

eHive.tests.__config
private

Helper class to provide a test-enabled version of the requested Runnable.

Entry point of RunnableTester. Run everything in orde

Initialise all the parameters the Runnable may need

Definition at line 92 of file tests.py.

◆ __created_worker_temp_directory

eHive.tests.__created_worker_temp_directory
private

Run the job's life cycle.

Run the method (one of "fetch_input", "run", "write_output", etc) if defined in the Runnable.

This must match BaseRunnable.__job_life_cycle

Capture and check the Runnable's own exceptions whilst letting the testcase's exceptions pass through

Extra tests once the job has ended Provide a temporary directory for the duration of the test. This functionality was handled by the Perl side (via GuestProcess but has to be reimplemented.

Definition at line 128 of file tests.py.

◆ __refEvents

eHive.tests.__refEvents
private

Definition at line 93 of file tests.py.

◆ _BaseRunnable__params

eHive.tests._BaseRunnable__params
private

Definition at line 100 of file tests.py.

◆ CompleteEarlyEvent

eHive.tests.CompleteEarlyEvent = collections.namedtuple('CompleteEarlyEvent', ['message'])

Definition at line 33 of file tests.py.

◆ DataflowEvent

eHive.tests.DataflowEvent = collections.namedtuple('DataflowEvent', ['output_ids', 'branch_name_or_code'])

Definition at line 32 of file tests.py.

◆ debug

eHive.tests.debug

Definition at line 112 of file tests.py.

◆ FailureEvent

eHive.tests.FailureEvent = collections.namedtuple('FailureEvent', ['exception', 'args'])

Definition at line 34 of file tests.py.

◆ input_job

eHive.tests.input_job

Definition at line 110 of file tests.py.

◆ WarningEvent

eHive.tests.WarningEvent = collections.namedtuple('WarningEvent', ['message', 'is_error'])

Definition at line 31 of file tests.py.