flowserv.tests.remote module

Implementation of the remote client for test purposes.

class flowserv.tests.remote.RemoteTestClient(runcount=5, error=None)

Bases: flowserv.controller.remote.client.RemoteClient

Implementation of the remote workflow engine client. Simulates the execution of a workflow. The remote workflow initially is in pending state. The first call to the get_workflow_state method will return a workflow in running state without actually stating any workflow execution. The next N calls to get_workflow_state will then simulate a runnign workflow. When the method is then called next either successful run or an error run is returned.

create_workflow(run: flowserv.model.base.RunObject, template: flowserv.model.template.base.WorkflowTemplate, arguments: Dict, staticfs: flowserv.volume.base.StorageVolume) flowserv.controller.remote.client.RemoteWorkflowHandle

Create a new instance of a workflow from the given workflow template and user-provided arguments.

Parameters
  • run (flowserv.model.base.RunObject) – Handle for the run that is being executed.

  • template (flowserv.model.template.base.WorkflowTemplate) – Workflow template containing the parameterized specification and the parameter declarations.

  • arguments (dict) – Dictionary of argument values for parameters in the template.

  • staticfs (flowserv.volume.base.StorageVolume) – Storage volume that contains the static files from the workflow template.

Return type

flowserv.controller.remote.client.RemoteWorkflowHandle

get_workflow_state(workflow_id: str, current_state: flowserv.model.workflow.state.WorkflowState) flowserv.model.workflow.state.WorkflowState

Get information about the current state of a given workflow.

Note, if the returned result is SUCCESS the workflow resource files may not have been initialized properly. This will be done by the workflow controller. The timestamps, however, should be set accurately.

Parameters
  • workflow_id (string) – Unique workflow identifier

  • current_state (flowserv.model.workflw.state.WorkflowState) – Last known state of the workflow by the workflow controller

Return type

flowserv.model.workflw.state.WorkflowState

stop_workflow(workflow_id: str)

Stop the execution of the workflow with the given identifier.

Sets the state to None to raise an error the next time the workflow state is polled.

Parameters

workflow_id (string) – Unique workflow identifier