toil.test.server.serverTest

Module Contents

Classes

ToilServerUtilsTest

Tests for the utility functions used by the Toil server.

hidden

FileStateStoreTest

Test file-based state storage.

FileStateStoreURLTest

Test file-based state storage using URLs instead of local paths.

BucketUsingTest

Base class for tests that need a bucket.

AWSStateStoreTest

Test AWS-based state storage.

AbstractToilWESServerTest

Class for server tests that provides a self.app in testing mode.

ToilWESServerBenchTest

Tests for Toil's Workflow Execution Service API that don't run workflows.

ToilWESServerWorkflowTest

Tests of the WES server running workflows.

ToilWESServerCeleryWorkflowTest

End-to-end workflow-running tests against Celery.

ToilWESServerCeleryS3StateWorkflowTest

Test the server with Celery and state stored in S3.

Attributes

logger

toil.test.server.serverTest.logger
class toil.test.server.serverTest.ToilServerUtilsTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Tests for the utility functions used by the Toil server.

test_workflow_canceling_recovery()[source]

Make sure that a workflow in CANCELING state will be recovered to a terminal state eventually even if the workflow runner Celery task goes away without flipping the state.

class toil.test.server.serverTest.hidden[source]
class AbstractStateStoreTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Basic tests for state stores.

abstract get_state_store()[source]

Make a state store to test, on a single fixed URL.

Return type:

AbstractStateStore

test_state_store()[source]

Make sure that the state store under test can store and load keys.

Return type:

None

class toil.test.server.serverTest.FileStateStoreTest(methodName='runTest')[source]

Bases: hidden

Test file-based state storage.

setUp()[source]

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

Return type:

None

get_state_store()[source]

Make a state store to test, on a single fixed local path.

Return type:

AbstractStateStore

class toil.test.server.serverTest.FileStateStoreURLTest(methodName='runTest')[source]

Bases: hidden

Test file-based state storage using URLs instead of local paths.

setUp()[source]

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

Return type:

None

get_state_store()[source]

Make a state store to test, on a single fixed URL.

Return type:

AbstractStateStore

class toil.test.server.serverTest.BucketUsingTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Base class for tests that need a bucket.

region: str | None
s3_resource: mypy_boto3_s3.S3ServiceResource | None
bucket: mypy_boto3_s3.service_resource.Bucket | None
bucket_name: str | None
classmethod setUpClass()[source]

Set up the class with a single pre-existing AWS bucket for all tests.

Return type:

None

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

Return type:

None

class toil.test.server.serverTest.AWSStateStoreTest(methodName='runTest')[source]

Bases: hidden, BucketUsingTest

Test AWS-based state storage.

bucket_path = 'prefix/of/keys'
get_state_store()[source]

Make a state store to test, on a single fixed URL.

Return type:

AbstractStateStore

test_state_store_paths()[source]

Make sure that the S3 state store puts things in the right places.

We don’t really care about the exact internal structure, but we do care about actually being under the path we are supposed to use.

Return type:

None

class toil.test.server.serverTest.AbstractToilWESServerTest(*args, **kwargs)[source]

Bases: toil.test.ToilTest

Class for server tests that provides a self.app in testing mode.

setUp()[source]

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

Return type:

None

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

Return type:

None

class toil.test.server.serverTest.ToilWESServerBenchTest(*args, **kwargs)[source]

Bases: AbstractToilWESServerTest

Tests for Toil’s Workflow Execution Service API that don’t run workflows.

test_home()[source]

Test the homepage endpoint.

Return type:

None

test_health()[source]

Test the health check endpoint.

Return type:

None

test_get_service_info()[source]

Test the GET /service-info endpoint.

Return type:

None

class toil.test.server.serverTest.ToilWESServerWorkflowTest(*args, **kwargs)[source]

Bases: AbstractToilWESServerTest

Tests of the WES server running workflows.

run_zip_workflow(zip_path, include_message=True, include_params=True)[source]

We have several zip file tests; this submits a zip file and makes sure it ran OK.

If include_message is set to False, don’t send a “message” argument in workflow_params. If include_params is also set to False, don’t send workflow_params at all.

Parameters:
  • zip_path (str)

  • include_message (bool)

  • include_params (bool)

Return type:

None

test_run_workflow_relative_url_no_attachments_fails()[source]

Test run example CWL workflow from relative workflow URL but with no attachments.

Return type:

None

test_run_workflow_relative_url()[source]

Test run example CWL workflow from relative workflow URL.

Return type:

None

test_run_workflow_https_url()[source]

Test run example CWL workflow from the Internet.

Return type:

None

test_run_workflow_single_file_zip()[source]

Test run example CWL workflow from single-file ZIP.

Return type:

None

test_run_workflow_multi_file_zip()[source]

Test run example CWL workflow from multi-file ZIP.

Return type:

None

test_run_workflow_manifest_zip()[source]

Test run example CWL workflow from ZIP with manifest.

Return type:

None

test_run_workflow_inputs_zip()[source]

Test run example CWL workflow from ZIP without manifest but with inputs.

Return type:

None

test_run_workflow_manifest_and_inputs_zip()[source]

Test run example CWL workflow from ZIP with manifest and inputs.

Return type:

None

test_run_workflow_no_params_zip()[source]

Test run example CWL workflow from ZIP without workflow_params.

Return type:

None

test_run_and_cancel_workflows()[source]

Run two workflows, cancel one of them, and make sure they all exist.

Return type:

None

class toil.test.server.serverTest.ToilWESServerCeleryWorkflowTest(*args, **kwargs)[source]

Bases: ToilWESServerWorkflowTest

End-to-end workflow-running tests against Celery.

class toil.test.server.serverTest.ToilWESServerCeleryS3StateWorkflowTest(*args, **kwargs)[source]

Bases: ToilWESServerWorkflowTest, BucketUsingTest

Test the server with Celery and state stored in S3.

setUp()[source]

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

Return type:

None