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.tool_util.verify package

Module of utilities for verifying test results.

galaxy.tool_util.verify.verify(item_label, output_content, attributes, filename=None, get_filecontent=None, get_filename=None, keep_outputs_dir=None, verify_extra_files=None, mode='file')[source]

Verify the content of a test output using test definitions described by attributes.

Throw an informative assertion error if any of these tests fail.

galaxy.tool_util.verify.make_temp_fname(fname=None)[source]

Safe temp name - preserve the file extension for tools that interpret it.

galaxy.tool_util.verify.files_delta(file1, file2, attributes=None)[source]

Check the contents of 2 files for size differences.

galaxy.tool_util.verify.files_diff(file1, file2, attributes=None)[source]

Check the contents of 2 files for differences.

galaxy.tool_util.verify.files_re_match(file1, file2, attributes=None)[source]

Check the contents of 2 files for differences using re.match.

galaxy.tool_util.verify.files_re_match_multiline(file1, file2, attributes=None)[source]

Check the contents of 2 files for differences using re.match in multiline mode.

galaxy.tool_util.verify.files_contains(file1, file2, attributes=None)[source]

Check the contents of file2 for substrings found in file1, on a per-line basis.

Submodules

galaxy.tool_util.verify.interactor module

class galaxy.tool_util.verify.interactor.OutputsDict[source]

Bases: collections.OrderedDict

Ordered dict that can also be accessed by index.

>>> out = OutputsDict()
>>> out['item1'] = 1
>>> out['item2'] = 2
>>> out[1] == 2 == out['item2']
True
galaxy.tool_util.verify.interactor.stage_data_in_history(galaxy_interactor, tool_id, all_test_data, history=None, force_path_paste=False, maxseconds=86400)[source]
class galaxy.tool_util.verify.interactor.GalaxyInteractorApi(**kwds)[source]

Bases: object

__init__(**kwds)[source]

Initialize self. See help(type(self)) for accurate signature.

property target_galaxy_version
property supports_test_data_download
get_tests_summary()[source]
get_tool_tests(tool_id, tool_version=None)[source]
verify_output_collection(output_collection_def, output_collection_id, history, tool_id)[source]
verify_output(history_id, jobs, output_data, output_testdef, tool_id, maxseconds)[source]
wait_for_jobs(history_id, jobs, maxseconds)[source]
verify_output_dataset(history_id, hda_id, outfile, attributes, tool_id)[source]
wait_for_job(job_id, history_id, maxseconds)[source]
wait_for(func, what='Tool test run', **kwd)[source]
get_job_stdio(job_id)[source]
new_history(history_name='test_history')[source]
test_data_path(tool_id, filename)[source]
test_data_download(tool_id, filename, mode='file')[source]
stage_data_async(test_data, history_id, tool_id, force_path_paste=False, maxseconds=86400)[source]
run_tool(testdef, history_id, resource_parameters={})[source]
output_hid(output_data)[source]
delete_history(history)[source]
format_for_summary(blob, empty_message, prefix='| ')[source]
ensure_user_with_email(email, password=None)[source]
exception galaxy.tool_util.verify.interactor.RunToolException(message, inputs=None)[source]

Bases: Exception

__init__(message, inputs=None)[source]

Initialize self. See help(type(self)) for accurate signature.

galaxy.tool_util.verify.interactor.verify_hid(filename, hda_id, attributes, test_data_downloader, hid='', dataset_fetcher=None, keep_outputs_dir=False)[source]
galaxy.tool_util.verify.interactor.verify_collection(output_collection_def, data_collection, verify_dataset)[source]
galaxy.tool_util.verify.interactor.verify_tool(tool_id, galaxy_interactor, resource_parameters=None, register_job_data=None, test_index=0, tool_version=None, quiet=False, test_history=None, force_path_paste=False, maxseconds=86400, tool_test_dicts=None)[source]
exception galaxy.tool_util.verify.interactor.JobOutputsError(output_exceptions, job_stdio)[source]

Bases: AssertionError

__init__(output_exceptions, job_stdio)[source]

Initialize self. See help(type(self)) for accurate signature.

class galaxy.tool_util.verify.interactor.ToolTestDescription(processed_test_dict)[source]

Bases: object

Encapsulates information about a tool test, and allows creation of a dynamic TestCase class (the unittest framework is very class oriented, doing dynamic tests in this way allows better integration)

__init__(processed_test_dict)[source]

Initialize self. See help(type(self)) for accurate signature.

test_data()[source]

Iterator over metadata representing the required files for upload.

to_dict()[source]
galaxy.tool_util.verify.interactor.test_data_iter(required_files)[source]

galaxy.tool_util.verify.script module

galaxy.tool_util.verify.script.main(argv=None)[source]

galaxy.tool_util.verify.test_data module

class galaxy.tool_util.verify.test_data.TestDataResolver(file_dirs=None, env_var='GALAXY_TEST_FILE_DIR', environ=environ({'ROOT_BUILD_CAUSE_SCMTRIGGER': 'true', 'AWS_SECRET_ACCESS_KEY': 'L+6N5EfuLyZB/84Hv0vAun6h9DXcn0pLcePGuSV9', 'GIT_URL': 'https://github.com/galaxyproject/galaxy/', 'XDG_SESSION_CLASS': 'user', 'XDG_SESSION_TYPE': 'tty', 'SHELL': '/bin/sh', 'GIT_COMMIT': 'df689cc2bd3f6d66b41b4037c127a7e8fcb2a686', 'BUILD_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/', 'BUILD_DISPLAY_NAME': '#3386', 'SSH_CONNECTION': '172.18.2.43 54564 172.18.2.52 22', 'PATH': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules/.bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules/.bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/games', 'XDG_RUNTIME_DIR': '/run/user/1000', 'VIRTUAL_ENV': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'HUDSON_HOME': '/var/lib/jenkins', 'WORKSPACE_TMP': '/var/jenkins/workspace/latest-Sphinx-Docs@tmp', 'HUDSON_SERVER_COOKIE': 'f442d5996560f01b', 'BUILD_CAUSE_SCMTRIGGER': 'true', 'EXECUTOR_NUMBER': '3', 'PWD': '/var/jenkins/workspace/latest-Sphinx-Docs', 'NPM_CONFIG_PREFIX': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'BUILD_ID': '3386', 'JOB_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/display/redirect', 'HOME': '/home/jenkins', 'HUDSON_URL': 'https://jenkins.galaxyproject.org/', 'NODE_LABELS': 'doc_builder n12.galaxyproject.org psu_node', 'LOGNAME': 'jenkins', 'GIT_PREVIOUS_COMMIT': '8324bfa1bb3567e7d229af15d445b41b4ce55494', 'JOB_BASE_NAME': 'latest-Sphinx-Docs', 'NODE_VIRTUAL_ENV': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'ROOT_BUILD_CAUSE': 'SCMTRIGGER', 'BUILD_TAG': 'jenkins-latest-Sphinx-Docs-3386', 'XDG_SESSION_ID': '3199', 'USER': 'jenkins', 'npm_config_prefix': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'JENKINS_HOME': '/var/lib/jenkins', 'JOB_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/', 'NODE_PATH': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules', 'GIT_PREVIOUS_SUCCESSFUL_COMMIT': '3417bb474258aae20b858a6b0ff08054b0ad3af4', 'JENKINS_SERVER_COOKIE': 'f442d5996560f01b', 'MAKEFLAGS': 'w', 'MFLAGS': '-w', 'SSH_CLIENT': '172.18.2.43 54564 22', 'MAIL': '/var/mail/jenkins', 'JENKINS_URL': 'https://jenkins.galaxyproject.org/', 'WORKSPACE': '/var/jenkins/workspace/latest-Sphinx-Docs', 'PS1': '(.venv) (.venv) $ ', 'AWS_ACCESS_KEY_ID': 'AKIAYX7HSEMC7DKPIMU7', 'GIT_BRANCH': 'origin/dev', 'RUN_CHANGES_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/display/redirect?page=changes', 'BUILD_NUMBER': '3386', 'RUN_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/display/redirect', 'JOB_NAME': 'latest-Sphinx-Docs', 'LANG': 'en_US.UTF-8', 'HUDSON_COOKIE': '0826b8b0-f50c-4f83-b79b-bcf4592f0a0d', 'BUILD_CAUSE': 'SCMTRIGGER', 'NODE_NAME': 'n12.galaxyproject.org', 'MAKELEVEL': '2', 'DOCUTILSCONFIG': '/var/jenkins/workspace/latest-Sphinx-Docs/doc/source/docutils.conf'}))[source]

Bases: object

__init__(file_dirs=None, env_var='GALAXY_TEST_FILE_DIR', environ=environ({'ROOT_BUILD_CAUSE_SCMTRIGGER': 'true', 'AWS_SECRET_ACCESS_KEY': 'L+6N5EfuLyZB/84Hv0vAun6h9DXcn0pLcePGuSV9', 'GIT_URL': 'https://github.com/galaxyproject/galaxy/', 'XDG_SESSION_CLASS': 'user', 'XDG_SESSION_TYPE': 'tty', 'SHELL': '/bin/sh', 'GIT_COMMIT': 'df689cc2bd3f6d66b41b4037c127a7e8fcb2a686', 'BUILD_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/', 'BUILD_DISPLAY_NAME': '#3386', 'SSH_CONNECTION': '172.18.2.43 54564 172.18.2.52 22', 'PATH': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules/.bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules/.bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/var/jenkins/workspace/latest-Sphinx-Docs/.venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/games', 'XDG_RUNTIME_DIR': '/run/user/1000', 'VIRTUAL_ENV': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'HUDSON_HOME': '/var/lib/jenkins', 'WORKSPACE_TMP': '/var/jenkins/workspace/latest-Sphinx-Docs@tmp', 'HUDSON_SERVER_COOKIE': 'f442d5996560f01b', 'BUILD_CAUSE_SCMTRIGGER': 'true', 'EXECUTOR_NUMBER': '3', 'PWD': '/var/jenkins/workspace/latest-Sphinx-Docs', 'NPM_CONFIG_PREFIX': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'BUILD_ID': '3386', 'JOB_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/display/redirect', 'HOME': '/home/jenkins', 'HUDSON_URL': 'https://jenkins.galaxyproject.org/', 'NODE_LABELS': 'doc_builder n12.galaxyproject.org psu_node', 'LOGNAME': 'jenkins', 'GIT_PREVIOUS_COMMIT': '8324bfa1bb3567e7d229af15d445b41b4ce55494', 'JOB_BASE_NAME': 'latest-Sphinx-Docs', 'NODE_VIRTUAL_ENV': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'ROOT_BUILD_CAUSE': 'SCMTRIGGER', 'BUILD_TAG': 'jenkins-latest-Sphinx-Docs-3386', 'XDG_SESSION_ID': '3199', 'USER': 'jenkins', 'npm_config_prefix': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv', 'JENKINS_HOME': '/var/lib/jenkins', 'JOB_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/', 'NODE_PATH': '/var/jenkins/workspace/latest-Sphinx-Docs/.venv/lib/node_modules', 'GIT_PREVIOUS_SUCCESSFUL_COMMIT': '3417bb474258aae20b858a6b0ff08054b0ad3af4', 'JENKINS_SERVER_COOKIE': 'f442d5996560f01b', 'MAKEFLAGS': 'w', 'MFLAGS': '-w', 'SSH_CLIENT': '172.18.2.43 54564 22', 'MAIL': '/var/mail/jenkins', 'JENKINS_URL': 'https://jenkins.galaxyproject.org/', 'WORKSPACE': '/var/jenkins/workspace/latest-Sphinx-Docs', 'PS1': '(.venv) (.venv) $ ', 'AWS_ACCESS_KEY_ID': 'AKIAYX7HSEMC7DKPIMU7', 'GIT_BRANCH': 'origin/dev', 'RUN_CHANGES_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/display/redirect?page=changes', 'BUILD_NUMBER': '3386', 'RUN_DISPLAY_URL': 'https://jenkins.galaxyproject.org/job/latest-Sphinx-Docs/3386/display/redirect', 'JOB_NAME': 'latest-Sphinx-Docs', 'LANG': 'en_US.UTF-8', 'HUDSON_COOKIE': '0826b8b0-f50c-4f83-b79b-bcf4592f0a0d', 'BUILD_CAUSE': 'SCMTRIGGER', 'NODE_NAME': 'n12.galaxyproject.org', 'MAKELEVEL': '2', 'DOCUTILSCONFIG': '/var/jenkins/workspace/latest-Sphinx-Docs/doc/source/docutils.conf'}))[source]

Initialize self. See help(type(self)) for accurate signature.

get_filename(name)[source]
get_filecontent(name)[source]
get_directory(name)[source]
galaxy.tool_util.verify.test_data.build_resolver(uri, environ)[source]
class galaxy.tool_util.verify.test_data.FileDataResolver(file_dir)[source]

Bases: object

__init__(file_dir)[source]

Initialize self. See help(type(self)) for accurate signature.

exists(filename)[source]
path(filename)[source]
class galaxy.tool_util.verify.test_data.GitDataResolver(repository, environ)[source]

Bases: galaxy.tool_util.verify.test_data.FileDataResolver

__init__(repository, environ)[source]

Initialize self. See help(type(self)) for accurate signature.

exists(filename)[source]
update_repository()[source]
execute(cmd)[source]