Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy_test.driver package

Submodules

galaxy_test.driver.driver_util module

Scripts for drivers of Galaxy functional tests.

galaxy_test.driver.driver_util.copy_database_template(source, db_path)[source]

Copy a ‘clean’ sqlite template database.

From file or URL to specified path for sqlite database.

galaxy_test.driver.driver_util.build_logger()[source]

Build a logger for test driver script.

galaxy_test.driver.driver_util.drive_test(test_driver_class)[source]

Instantiate driver class, run, and exit appropriately.

galaxy_test.driver.driver_util.database_conf(db_path, prefix='GALAXY', prefer_template_database=False)[source]

Find (and populate if needed) Galaxy database connection.

galaxy_test.driver.driver_util.get_webapp_global_conf()[source]

Get the global_conf dictionary sent to app_factory.

galaxy_test.driver.driver_util.setup_galaxy_config(tmpdir, use_test_file_dir=False, default_install_db_merged=True, default_tool_data_table_config_path=None, default_shed_tool_data_table_config=None, default_job_config_file=None, enable_tool_shed_check=False, default_tool_conf=None, shed_tool_conf=None, datatypes_conf=None, update_integrated_tool_panel=False, prefer_template_database=False, log_format=None, conda_auto_init=False, conda_auto_install=False, use_shared_connection_for_amqp=False, allow_tool_conf_override: bool = True, allow_path_paste=False)[source]

Setup environment and build config for test Galaxy instance.

class galaxy_test.driver.driver_util.TestDriver[source]

Bases: object

Responsible for the life-cycle of a Galaxy-style functional test.

Sets up servers, configures tests, and tears things down. This is somewhat like a Python TestCase - but different because it is meant to provide a main() endpoint.

__init__()[source]

Setup tracked resources.

setup() → None[source]

Called before tests are built.

tear_down() → None[source]

Cleanup resources tracked by this object.

stop_servers() → None[source]
mkdtemp() → str[source]

Return a temp directory that is properly cleaned up or not based on the config.

galaxy_test.driver.driver_util.wait_for_http_server(host, port, prefix=None, sleep_amount=0.1, sleep_tries=150)[source]

Wait for an HTTP server to boot up.

galaxy_test.driver.integration_setup module

Test classes that should be shared between test scenarios.

galaxy_test.driver.integration_setup.get_posix_file_source_config(root_dir: str, roles: str, groups: str, include_test_data_dir: bool, prefer_links: bool = False) → str[source]
galaxy_test.driver.integration_setup.create_file_source_config_file_on(temp_dir: str, root_dir: str, include_test_data_dir: bool, required_role_expression: str, required_group_expression: str, prefer_links: bool = False)[source]
class galaxy_test.driver.integration_setup.PosixFileSourceSetup[source]

Bases: object

root_dir: str
include_test_data_dir: ClassVar[bool] = False
required_role_expression: str = 'user@bx.psu.edu'
required_group_expression: str = ''
classmethod handle_galaxy_config_kwds(config)[source]
class galaxy_test.driver.integration_setup.CuratedWorkflowsNetworkGuard[source]

Bases: object

Keeps curated workflow tests offline.

The feature’s one outbound request is the IWC manifest download. Both it and the refresh that would trigger it are replaced with functions that raise, and every test asserts the download was never attempted.

download_mock: MagicMock
refresh_mock: MagicMock
setUp()[source]
tearDown()[source]
galaxy_test.driver.integration_setup.store_raw_annotation(app: UniverseApplication, workflow_id: str, annotation: str) → None[source]

Annotate a stored workflow straight in the database.

Bypasses the API write path on purpose, so a test can store exactly the text it means to - including text a write would sanitize.

galaxy_test.driver.integration_util module

Utilities for constructing Galaxy integration tests.

Tests that start an actual Galaxy server with a particular configuration in order to test something that cannot be tested with the default functional/api testing configuration.

class galaxy_test.driver.integration_util.CachedToolBoxIntegrationMixin[source]

Bases: object

Run an existing integration-test configuration with lazy tools.

classmethod handle_galaxy_config_kwds(config)[source]
galaxy_test.driver.integration_util.docker_run(image, name, *args, detach=True, remove=True, ports=None, env_vars: dict[str, str] | None = None)[source]
galaxy_test.driver.integration_util.docker_exec(container_name, *args, output=True)[source]
galaxy_test.driver.integration_util.docker_ip_address(container_name)[source]
galaxy_test.driver.integration_util.docker_rm(container_name)[source]
galaxy_test.driver.integration_util.skip_if_jenkins(cls)[source]
galaxy_test.driver.integration_util.skip_unless_amqp()[source]
galaxy_test.driver.integration_util.skip_unless_postgres()[source]
galaxy_test.driver.integration_util.skip_unless_docker()[source]
galaxy_test.driver.integration_util.skip_unless_kubernetes()[source]
galaxy_test.driver.integration_util.k8s_config_path()[source]
galaxy_test.driver.integration_util.skip_unless_fixed_port()[source]
galaxy_test.driver.integration_util.skip_for_older_python(min_python_version)[source]
galaxy_test.driver.integration_util.skip_if_github_workflow()[source]
class galaxy_test.driver.integration_util.IntegrationInstance[source]

Bases: UsesApiTestCaseMixin, UsesCeleryTasks

Unit test case with utilities for spinning up Galaxy.

prefer_template_database = True
isolate_galaxy_config = True
dataset_populator: BaseDatasetPopulator | None
classmethod setUpClass()[source]

Configure and start Galaxy for a test.

classmethod tearDownClass()[source]

Shutdown Galaxy server and cleanup temp directory.

tearDown()[source]
setUp()[source]
restart(handle_reconfig=None)[source]
classmethod temp_config_dir(name)[source]
history_id() → Iterator[str][source]
class galaxy_test.driver.integration_util.IntegrationTestCase[source]

Bases: IntegrationInstance, TestCase

Unit TestCase with utilities for spinning up Galaxy.

galaxy_test.driver.integration_util.integration_module_instance(clazz: type[IntegrationInstance])[source]
galaxy_test.driver.integration_util.integration_tool_runner(tool_ids)[source]
class galaxy_test.driver.integration_util.ConfiguresObjectStores[source]

Bases: object

object_stores_parent: ClassVar[str]
classmethod write_object_store_config_file(filename: str, contents: str) → str[source]
class galaxy_test.driver.integration_util.ConfiguresFileSourceTemplates[source]

Bases: object

class galaxy_test.driver.integration_util.ConfiguresObjectStoreTemplates[source]

Bases: object

class galaxy_test.driver.integration_util.ConfiguresDatabaseVault[source]

Bases: object

class galaxy_test.driver.integration_util.ConfiguresWorkflowScheduling[source]

Bases: object

class galaxy_test.driver.integration_util.ConfigureAllowedUrlHeaders[source]

Bases: object

galaxy_test.driver.test_logging module

galaxy_test.driver.testcase module

class galaxy_test.driver.testcase.DrivenFunctionalTestCase[source]

Bases: FunctionalTestCase

Variant of FunctionalTestCase that can launch Galaxy instances.

galaxy_driver_class

alias of TestDriver