cerise.back_end.test package

Submodules

cerise.back_end.test.conftest module

cerise.back_end.test.mock_job module

class cerise.back_end.test.mock_job.MockJob(job_id, name, workflow, job_input)[source]

Bases: object

This class provides an in-memory implementation of a job.

It’s used for testing, so that we don’t need to bother with a database there.

Creates a new Job object.

The state of a newly created job is JobState.SUBMITTED.

Parameters:
  • id (str) – The id of the job, a string containing a GUID
  • name (str) – The name of the job, as given by the user
  • workflow (str) – The URI of the workflow file
  • job_input (str) – An input definition for the job
add_log(level, message)[source]

Add a message to the job’s log.

Parameters:
  • level (logging.LogLevel) – Level of importance
  • message (str) – The log message.
critical(message)[source]

Add a message to the job’s log at level CRITICAL.

Parameters:message (str) – The log message.
debug(message)[source]

Add a message to the job’s log at level DEBUG.

Parameters:message (str) – The log message.
error(message)[source]

Add a message to the job’s log at level ERROR.

Parameters:message (str) – The log message.
id = None

Job id, a string containing a UUID.

Type:str
info(message)[source]

Add a message to the job’s log at level INFO.

Parameters:message (str) – The log message.
local_input = None

Input JSON string, as specified by the submitter.

Type:str
local_output = None

The serialised JSON output object describing the destaged outputs.

Type:str
log = None

Log output as of last update.

Type:str
name = None

Name, as specified by the submitter.

Type:str
please_delete = None

Whether deletion of the job has been requested.

Type:bool
remote_error = None

cwl-runner stderr output as of last update.

Type:str
remote_input_path = None

The absolute remote path of the input description file.

Type:str
remote_job_id = None

The id the remote scheduler gave to this job.

Type:str
remote_output = None

cwl-runner output as of last update.

Type:str
remote_stderr_path = None

The absolute remote path of the standard error dump.

Type:str
remote_stdout_path = None

The absolute remote path of the standard output dump.

Type:str
remote_system_err_path = None

The absolute remote path of the standard error dump.

Type:str
remote_system_out_path = None

The absolute remote path of the system output dump.

Type:str
remote_workdir_path = None

The absolute remote path of the working directory.

Type:str
remote_workflow_path = None

The absolute remote path of the CWL workflow file.

Type:str
required_num_cores = None

The number of cores to reserve for this workflow. If 0, use cluster default.

resolve_retry_count = None

Number of times we’ve tried to resolve inputs.

Type:int
state = None

Current state of the job.

Type:JobState
time_limit = None

The time to reserve, in seconds. If 0, use cluster default.

try_transition(from_state, to_state)[source]

Attempts to transition the job’s state to a new one.

If the current state equals from_state, it is set to to_state, and True is returned, otherwise False is returned and the current state remains what it was.

Parameters:
  • from_state (JobState) – The expected current state
  • to_state (JobState) – The desired next state
Returns:

True iff the transition was successful.

warning(message)[source]

Add a message to the job’s log at level WARNING.

Parameters:message (str) – The log message.
workflow = None

Workflow file URI, as specified by the submitter.

Type:str
workflow_content = None

The content of the workflow description file, or None if it has not been resolved yet.

Type:Union[bytes, NoneType]

cerise.back_end.test.test_cwl module

cerise.back_end.test.test_job_planner module

cerise.back_end.test.test_job_planner.test_job_planner_init(mock_config, mock_store_resolved, local_api_dir)[source]
cerise.back_end.test.test_job_planner.test_plan_job(mock_config, mock_store_resolved, local_api_dir)[source]

cerise.back_end.test.test_job_runner module

cerise.back_end.test.test_local_files module

cerise.back_end.test.test_remote_api module

cerise.back_end.test.test_remote_job_files module

Module contents