From 096d856c1d41a80b5d1392af4e8267f3ee82bad1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 24 Sep 2021 13:17:24 -0400 Subject: [PATCH 01/14] Package galaxy_mock.py into galaxy-app and changes required to support that. --- .../galaxy/app_unittest_utils}/__init__.py | 0 .../base => galaxy/app_unittest_utils}/celery_helper.py | 0 .../galaxy/app_unittest_utils}/galaxy_mock.py | 2 +- lib/galaxy_test/driver/driver_util.py | 2 +- packages/app/galaxy/app_unittest_utils | 1 + packages/app/setup.py | 1 + test/unit/authnz/test_custos_authnz.py | 2 +- test/unit/managers/base.py | 2 +- test/unit/managers/test_HistoryManager.py | 2 +- test/unit/queue_worker/conftest.py | 2 +- test/unit/tools/test_data_parameters.py | 2 +- test/unit/tools/test_history_imp_exp.py | 2 +- test/unit/tools/test_tool_validation.py | 2 +- test/unit/tools_support.py | 4 ++-- test/unit/visualizations/plugins/test_VisualizationPlugin.py | 2 +- .../visualizations/plugins/test_VisualizationsRegistry.py | 2 +- test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py | 3 +-- test/unit/webapps/test_webapp_base.py | 2 +- 18 files changed, 17 insertions(+), 16 deletions(-) rename {test/unit/unittest_utils => lib/galaxy/app_unittest_utils}/__init__.py (100%) rename lib/{galaxy_test/base => galaxy/app_unittest_utils}/celery_helper.py (100%) rename {test/unit/unittest_utils => lib/galaxy/app_unittest_utils}/galaxy_mock.py (99%) create mode 120000 packages/app/galaxy/app_unittest_utils diff --git a/test/unit/unittest_utils/__init__.py b/lib/galaxy/app_unittest_utils/__init__.py similarity index 100% rename from test/unit/unittest_utils/__init__.py rename to lib/galaxy/app_unittest_utils/__init__.py diff --git a/lib/galaxy_test/base/celery_helper.py b/lib/galaxy/app_unittest_utils/celery_helper.py similarity index 100% rename from lib/galaxy_test/base/celery_helper.py rename to lib/galaxy/app_unittest_utils/celery_helper.py diff --git a/test/unit/unittest_utils/galaxy_mock.py b/lib/galaxy/app_unittest_utils/galaxy_mock.py similarity index 99% rename from test/unit/unittest_utils/galaxy_mock.py rename to lib/galaxy/app_unittest_utils/galaxy_mock.py index 7c03038a162..700ba4a848c 100644 --- a/test/unit/unittest_utils/galaxy_mock.py +++ b/lib/galaxy/app_unittest_utils/galaxy_mock.py @@ -25,7 +25,7 @@ from galaxy.util import StructuredExecutionTimer from galaxy.util.bunch import Bunch from galaxy.util.dbkeys import GenomeBuilds from galaxy.web_stack import ApplicationStack -from galaxy_test.base.celery_helper import rebind_container_to_task +from .celery_helper import rebind_container_to_task # ============================================================================= diff --git a/lib/galaxy_test/driver/driver_util.py b/lib/galaxy_test/driver/driver_util.py index e0868ba2115..75c1c54511b 100644 --- a/lib/galaxy_test/driver/driver_util.py +++ b/lib/galaxy_test/driver/driver_util.py @@ -26,6 +26,7 @@ import yaml from paste import httpserver from galaxy.app import UniverseApplication as GalaxyUniverseApplication +from galaxy.app_unittest_utils.celery_helper import rebind_container_to_task from galaxy.config import LOGGING_CONFIG_DEFAULT from galaxy.model import mapping from galaxy.model.database_utils import create_database, database_exists @@ -35,7 +36,6 @@ from galaxy.util import asbool, download_to_file, galaxy_directory from galaxy.util.properties import load_app_properties from galaxy.webapps.galaxy import buildapp from galaxy_test.base.api_util import get_admin_api_key, get_user_api_key -from galaxy_test.base.celery_helper import rebind_container_to_task from galaxy_test.base.env import ( DEFAULT_WEB_HOST, target_url_parts, diff --git a/packages/app/galaxy/app_unittest_utils b/packages/app/galaxy/app_unittest_utils new file mode 120000 index 00000000000..2975210819e --- /dev/null +++ b/packages/app/galaxy/app_unittest_utils @@ -0,0 +1 @@ +../../../lib/galaxy/app_unittest_utils/ \ No newline at end of file diff --git a/packages/app/setup.py b/packages/app/setup.py index f0b961fea2a..df901be5079 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -32,6 +32,7 @@ TEST_DIR = 'tests' PACKAGES = [ 'galaxy', 'galaxy.actions', + 'galaxy.app_unittest_utils', 'galaxy.config', 'galaxy.files', 'galaxy.files.sources', diff --git a/test/unit/authnz/test_custos_authnz.py b/test/unit/authnz/test_custos_authnz.py index 7f230cca4e4..5c46351d386 100644 --- a/test/unit/authnz/test_custos_authnz.py +++ b/test/unit/authnz/test_custos_authnz.py @@ -13,10 +13,10 @@ from urllib.parse import ( import jwt import requests +from galaxy.app_unittest_utils.galaxy_mock import MockTrans from galaxy.authnz import custos_authnz from galaxy.model import CustosAuthnzToken, User from galaxy.util import unicodify -from ..unittest_utils.galaxy_mock import MockTrans class CustosAuthnzTestCase(unittest.TestCase): diff --git a/test/unit/managers/base.py b/test/unit/managers/base.py index 0dfec760cff..d3ecbddcb44 100644 --- a/test/unit/managers/base.py +++ b/test/unit/managers/base.py @@ -6,8 +6,8 @@ import unittest import sqlalchemy +from galaxy.app_unittest_utils import galaxy_mock from galaxy.managers.users import UserManager -from ..unittest_utils import galaxy_mock # ============================================================================= admin_email = 'admin@admin.admin' diff --git a/test/unit/managers/test_HistoryManager.py b/test/unit/managers/test_HistoryManager.py index 1a151c85a9b..59b999a755f 100644 --- a/test/unit/managers/test_HistoryManager.py +++ b/test/unit/managers/test_HistoryManager.py @@ -10,6 +10,7 @@ from galaxy import ( exceptions, model ) +from galaxy.app_unittest_utils import galaxy_mock from galaxy.managers import ( base, hdas @@ -21,7 +22,6 @@ from galaxy.managers.histories import ( HistorySerializer ) from .base import BaseTestCase -from ..unittest_utils import galaxy_mock default_password = '123456' user2_data = dict(email='user2@user2.user2', username='user2', password=default_password) diff --git a/test/unit/queue_worker/conftest.py b/test/unit/queue_worker/conftest.py index 725724463d2..89131ba7613 100644 --- a/test/unit/queue_worker/conftest.py +++ b/test/unit/queue_worker/conftest.py @@ -8,8 +8,8 @@ try: except ImportError: psycopg2 = None +from galaxy.app_unittest_utils import galaxy_mock from galaxy.util import which -from ..unittest_utils import galaxy_mock def create_base_test(connection, amqp_type, amqp_connection=None): diff --git a/test/unit/tools/test_data_parameters.py b/test/unit/tools/test_data_parameters.py index dfa93fbbf19..d81a55a35e2 100644 --- a/test/unit/tools/test_data_parameters.py +++ b/test/unit/tools/test_data_parameters.py @@ -1,6 +1,6 @@ from galaxy import model +from galaxy.app_unittest_utils import galaxy_mock from .util import BaseParameterTestCase -from ..unittest_utils import galaxy_mock class DataToolParameterTestCase(BaseParameterTestCase): diff --git a/test/unit/tools/test_history_imp_exp.py b/test/unit/tools/test_history_imp_exp.py index b57f9794661..a83ab4f1204 100644 --- a/test/unit/tools/test_history_imp_exp.py +++ b/test/unit/tools/test_history_imp_exp.py @@ -5,13 +5,13 @@ import tempfile from shutil import rmtree from galaxy import model +from galaxy.app_unittest_utils.galaxy_mock import MockApp from galaxy.exceptions import MalformedContents from galaxy.objectstore.unittest_utils import ( Config as TestConfig, ) from galaxy.tools.imp_exp import JobExportHistoryArchiveWrapper, JobImportHistoryArchiveWrapper, unpack_tar_gz_archive from galaxy.tools.imp_exp.export_history import create_archive -from ..unittest_utils.galaxy_mock import MockApp # good enough for the very specific tests we're writing as of now... diff --git a/test/unit/tools/test_tool_validation.py b/test/unit/tools/test_tool_validation.py index ff02f3af72d..0d4a3a9a284 100644 --- a/test/unit/tools/test_tool_validation.py +++ b/test/unit/tools/test_tool_validation.py @@ -4,10 +4,10 @@ import tarfile import tempfile from contextlib import contextmanager +from galaxy.app_unittest_utils.galaxy_mock import MockApp from galaxy.tools.repositories import ValidationContext from galaxy.util import galaxy_directory from tool_shed.tools.tool_validator import ToolValidator -from ..unittest_utils.galaxy_mock import MockApp BISMARK_TAR = os.path.join(galaxy_directory(), 'lib/tool_shed/test/test_data/bismark/bismark.tar') BOWTIE2_INDICES = os.path.join(galaxy_directory(), 'lib/tool_shed/test/test_data/bowtie2_loc_sample/bowtie2_indices.loc.sample') diff --git a/test/unit/tools_support.py b/test/unit/tools_support.py index b3f5326b519..7295b15b7de 100644 --- a/test/unit/tools_support.py +++ b/test/unit/tools_support.py @@ -11,10 +11,10 @@ from collections import defaultdict import galaxy.datatypes.registry import galaxy.model +from galaxy.app_unittest_utils.galaxy_mock import MockApp from galaxy.tool_util.parser import get_tool_source from galaxy.tools import create_tool_from_source from galaxy.util.bunch import Bunch -from .unittest_utils import galaxy_mock datatypes_registry = galaxy.datatypes.registry.Registry() @@ -26,7 +26,7 @@ class UsesApp: def setup_app(self): self.test_directory = tempfile.mkdtemp() - self.app = galaxy_mock.MockApp() + self.app = MockApp() self.app.config.new_file_path = os.path.join(self.test_directory, "new_files") self.app.config.admin_users = "mary@example.com" self.app.job_search = None diff --git a/test/unit/visualizations/plugins/test_VisualizationPlugin.py b/test/unit/visualizations/plugins/test_VisualizationPlugin.py index e8e76c7888b..791c4e3d5f8 100644 --- a/test/unit/visualizations/plugins/test_VisualizationPlugin.py +++ b/test/unit/visualizations/plugins/test_VisualizationPlugin.py @@ -3,6 +3,7 @@ Test lib/galaxy/visualization/plugins/plugin. """ import unittest +from galaxy.app_unittest_utils import galaxy_mock from galaxy.util import clean_multiline_string from galaxy.visualization.plugins import ( plugin as vis_plugin, @@ -10,7 +11,6 @@ from galaxy.visualization.plugins import ( utils as vis_utils ) from . import VisualizationsBase_TestCase -from ...unittest_utils import galaxy_mock class VisualizationsPlugin_TestCase(VisualizationsBase_TestCase): diff --git a/test/unit/visualizations/plugins/test_VisualizationsRegistry.py b/test/unit/visualizations/plugins/test_VisualizationsRegistry.py index 7a655ab06e8..89bbad68abc 100644 --- a/test/unit/visualizations/plugins/test_VisualizationsRegistry.py +++ b/test/unit/visualizations/plugins/test_VisualizationsRegistry.py @@ -6,11 +6,11 @@ import re import unittest from galaxy import model +from galaxy.app_unittest_utils import galaxy_mock from galaxy.util import clean_multiline_string, galaxy_directory from galaxy.visualization.plugins import plugin from galaxy.visualization.plugins.registry import VisualizationsRegistry from . import VisualizationsBase_TestCase -from ...unittest_utils import galaxy_mock glx_dir = galaxy_directory() template_cache_dir = os.path.join(glx_dir, 'database', 'compiled_templates') diff --git a/test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py b/test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py index 2a3dd5e22d7..d3236eaf894 100644 --- a/test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py +++ b/test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py @@ -12,9 +12,8 @@ from httpx import AsyncClient pytest.importorskip("starlette_context") from starlette_context import context as request_context - +from galaxy.app_unittest_utils.galaxy_mock import MockApp from galaxy.webapps.galaxy.fast_app import add_request_id_middleware -from ..unittest_utils.galaxy_mock import MockApp app = FastAPI() GX_APP = None diff --git a/test/unit/webapps/test_webapp_base.py b/test/unit/webapps/test_webapp_base.py index 477419b2734..a9675774e84 100644 --- a/test/unit/webapps/test_webapp_base.py +++ b/test/unit/webapps/test_webapp_base.py @@ -6,8 +6,8 @@ import re import unittest import galaxy.config +from galaxy.app_unittest_utils import galaxy_mock from galaxy.webapps.base import webapp as Webapp -from ..unittest_utils import galaxy_mock log = logging.getLogger(__name__) From db61f411ba9d2602fd05763dec714d199818caf8 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 26 Sep 2021 09:43:36 -0400 Subject: [PATCH 02/14] Package tools_support.py into galaxy-app and changes required to support that. --- .../galaxy/app_unittest_utils}/tools_support.py | 0 test/unit/jobs/test_job_wrapper.py | 2 +- test/unit/jobs/test_runner_local.py | 8 ++++---- test/unit/tools/test_actions.py | 2 +- test/unit/tools/test_collect_primary_datasets.py | 2 +- test/unit/tools/test_column_parameters.py | 2 +- test/unit/tools/test_dataset_matcher.py | 2 +- test/unit/tools/test_evaluation.py | 3 +-- test/unit/tools/test_execution.py | 2 +- test/unit/tools/test_metadata.py | 2 +- test/unit/tools/test_toolbox.py | 2 +- test/unit/tools/util.py | 2 +- 12 files changed, 14 insertions(+), 15 deletions(-) rename {test/unit => lib/galaxy/app_unittest_utils}/tools_support.py (100%) diff --git a/test/unit/tools_support.py b/lib/galaxy/app_unittest_utils/tools_support.py similarity index 100% rename from test/unit/tools_support.py rename to lib/galaxy/app_unittest_utils/tools_support.py diff --git a/test/unit/jobs/test_job_wrapper.py b/test/unit/jobs/test_job_wrapper.py index 1e3a8796f3e..676b5b0e653 100644 --- a/test/unit/jobs/test_job_wrapper.py +++ b/test/unit/jobs/test_job_wrapper.py @@ -2,6 +2,7 @@ import os from contextlib import contextmanager from unittest import TestCase +from galaxy.app_unittest_utils.tools_support import UsesApp from galaxy.jobs import ( JobWrapper, TaskWrapper @@ -13,7 +14,6 @@ from galaxy.model import ( ) from galaxy.tools import evaluation from galaxy.util.bunch import Bunch -from ..tools_support import UsesApp TEST_TOOL_ID = "cufftest" TEST_VERSION_COMMAND = "bwa --version" diff --git a/test/unit/jobs/test_runner_local.py b/test/unit/jobs/test_runner_local.py index cc9b7a58281..c22160870c0 100644 --- a/test/unit/jobs/test_runner_local.py +++ b/test/unit/jobs/test_runner_local.py @@ -7,12 +7,12 @@ import psutil from galaxy import job_metrics from galaxy import model +from galaxy.app_unittest_utils.tools_support import ( + UsesApp, + UsesTools, +) from galaxy.jobs.runners import local from galaxy.util import bunch -from ..tools_support import ( - UsesApp, - UsesTools -) class TestLocalJobRunner(TestCase, UsesApp, UsesTools): diff --git a/test/unit/tools/test_actions.py b/test/unit/tools/test_actions.py index 83432cd3906..fe4f9eaabfd 100644 --- a/test/unit/tools/test_actions.py +++ b/test/unit/tools/test_actions.py @@ -2,6 +2,7 @@ import string import unittest from galaxy import model +from galaxy.app_unittest_utils import tools_support from galaxy.exceptions import UserActivationRequiredException from galaxy.tool_util.parser.output_objects import ToolOutput from galaxy.tools.actions import ( @@ -10,7 +11,6 @@ from galaxy.tools.actions import ( on_text_for_names ) from galaxy.util import XML -from .. import tools_support # I cannot think of a saner way to test if data is being wrapped than use a diff --git a/test/unit/tools/test_collect_primary_datasets.py b/test/unit/tools/test_collect_primary_datasets.py index b076bb7f6c5..d462ccda910 100644 --- a/test/unit/tools/test_collect_primary_datasets.py +++ b/test/unit/tools/test_collect_primary_datasets.py @@ -6,9 +6,9 @@ from galaxy import ( model, util ) +from galaxy.app_unittest_utils import tools_support from galaxy.tool_util.parser import output_collection_def from galaxy.tool_util.provided_metadata import LegacyToolProvidedMetadata, NullToolProvidedMetadata -from .. import tools_support DEFAULT_TOOL_OUTPUT = "out1" DEFAULT_EXTRA_NAME = "test1" diff --git a/test/unit/tools/test_column_parameters.py b/test/unit/tools/test_column_parameters.py index e8587309461..5ef38893cb6 100644 --- a/test/unit/tools/test_column_parameters.py +++ b/test/unit/tools/test_column_parameters.py @@ -2,9 +2,9 @@ test_select_parameters.py. """ from galaxy import model +from galaxy.app_unittest_utils.tools_support import datatypes_registry from galaxy.util import bunch from .util import BaseParameterTestCase -from ..tools_support import datatypes_registry class DataColumnParameterTestCase(BaseParameterTestCase): diff --git a/test/unit/tools/test_dataset_matcher.py b/test/unit/tools/test_dataset_matcher.py index 720f8c6cd53..6d13ab1ecee 100644 --- a/test/unit/tools/test_dataset_matcher.py +++ b/test/unit/tools/test_dataset_matcher.py @@ -1,6 +1,7 @@ from unittest import TestCase from galaxy import model +from galaxy.app_unittest_utils.tools_support import UsesApp from galaxy.tools.parameters import ( basic, dataset_matcher @@ -10,7 +11,6 @@ from galaxy.util import ( XML, ) from .test_data_parameters import MockHistoryDatasetAssociation -from ..tools_support import UsesApp class DatasetMatcherTestCase(TestCase, UsesApp): diff --git a/test/unit/tools/test_evaluation.py b/test/unit/tools/test_evaluation.py index 154d1f3ebc7..507e70a3c99 100644 --- a/test/unit/tools/test_evaluation.py +++ b/test/unit/tools/test_evaluation.py @@ -1,6 +1,7 @@ import os from unittest import TestCase +from galaxy.app_unittest_utils.tools_support import UsesApp from galaxy.job_execution.datasets import DatasetPath from galaxy.jobs import SimpleComputeEnvironment from galaxy.model import ( @@ -28,8 +29,6 @@ from galaxy.tools.parameters.grouping import ( ) from galaxy.util import XML from galaxy.util.bunch import Bunch -# Test fixtures for Galaxy infrastructure. -from ..tools_support import UsesApp # To Test: # - param_file handling. diff --git a/test/unit/tools/test_execution.py b/test/unit/tools/test_execution.py index bc3cd0618bc..d7e669c6c2e 100644 --- a/test/unit/tools/test_execution.py +++ b/test/unit/tools/test_execution.py @@ -6,9 +6,9 @@ from unittest import TestCase import webob.exc import galaxy.model +from galaxy.app_unittest_utils import tools_support from galaxy.tools.parameters import params_to_incoming from galaxy.util.bunch import Bunch -from .. import tools_support BASE_REPEAT_TOOL_CONTENTS = ''' echo "$param1" #for $r in $repeat# "$r.param2" #end for# < $out1 diff --git a/test/unit/tools/test_metadata.py b/test/unit/tools/test_metadata.py index 8f802a11071..5123c56c815 100644 --- a/test/unit/tools/test_metadata.py +++ b/test/unit/tools/test_metadata.py @@ -3,11 +3,11 @@ import subprocess import unittest from galaxy import model +from galaxy.app_unittest_utils import tools_support from galaxy.job_execution.datasets import DatasetPath from galaxy.metadata import get_metadata_compute_strategy from galaxy.objectstore import ObjectStorePopulator from galaxy.util import safe_makedirs -from .. import tools_support class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.UsesTools): diff --git a/test/unit/tools/test_toolbox.py b/test/unit/tools/test_toolbox.py index b96ce13e9ef..dfcedefe856 100644 --- a/test/unit/tools/test_toolbox.py +++ b/test/unit/tools/test_toolbox.py @@ -10,6 +10,7 @@ import pytest import routes from galaxy import model +from galaxy.app_unittest_utils.tools_support import UsesApp, UsesTools from galaxy.config_watchers import ConfigWatchers from galaxy.model import tool_shed_install from galaxy.model.tool_shed_install import mapping @@ -17,7 +18,6 @@ from galaxy.tool_util.unittest_utils import mock_trans from galaxy.tool_util.unittest_utils.sample_data import SIMPLE_MACRO, SIMPLE_TOOL_WITH_MACRO from galaxy.tools import ToolBox from galaxy.tools.cache import ToolCache -from ..tools_support import UsesApp, UsesTools log = logging.getLogger(__name__) diff --git a/test/unit/tools/util.py b/test/unit/tools/util.py index 163d1a0480e..8c2c5f80675 100644 --- a/test/unit/tools/util.py +++ b/test/unit/tools/util.py @@ -1,12 +1,12 @@ from unittest import TestCase from galaxy import model +from galaxy.app_unittest_utils.tools_support import UsesApp from galaxy.tools.parameters import basic from galaxy.util import ( bunch, XML, ) -from ..tools_support import UsesApp class BaseParameterTestCase(TestCase, UsesApp): From fe0c4ab4e2a03f88febfd4457dfb8138b8069314 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 24 Sep 2021 12:21:31 -0400 Subject: [PATCH 03/14] Migrate more unit tests into galaxy-app's test suite. --- packages/app/tests/app | 1 + test/unit/{authnz => app}/__init__.py | 0 test/unit/{files => app/authnz}/__init__.py | 0 test/unit/{ => app}/authnz/test_custos_authnz.py | 0 test/unit/{jobs => app/files}/__init__.py | 0 test/unit/{ => app}/files/_util.py | 0 test/unit/{ => app}/files/dropbox_file_sources_conf.yml | 0 test/unit/app/files/file_sources_conf.yml | 1 + test/unit/{ => app}/files/s3_file_sources_conf.yml | 0 test/unit/{ => app}/files/test_dropbox.py | 0 test/unit/{ => app}/files/test_posix.py | 0 test/unit/{ => app}/files/test_s3.py | 0 test/unit/{ => app}/files/test_webdav.py | 0 test/unit/{ => app}/files/webdav_user_file_sources_conf.yml | 0 .../{jobs/dynamic_tool_destination => app/jobs}/__init__.py | 0 test/unit/{ => app}/jobs/conditional_runners_job_conf.xml | 0 .../jobs/dynamic_tool_destination}/__init__.py | 0 .../{ => app}/jobs/dynamic_tool_destination/data/dest_fail.yml | 0 .../{ => app}/jobs/dynamic_tool_destination/data/job_conf.xml | 0 .../dynamic_tool_destination/data/priority_tool_destination.yml | 0 .../{ => app}/jobs/dynamic_tool_destination/data/test.empty | 0 .../{ => app}/jobs/dynamic_tool_destination/data/test.fasta | 0 .../{ => app}/jobs/dynamic_tool_destination/data/test1.full | 0 .../{ => app}/jobs/dynamic_tool_destination/data/test3.full | 0 .../jobs/dynamic_tool_destination/data/test_no_verbose.yml | 0 .../dynamic_tool_destination/data/test_num_input_datasets.yml | 0 .../{ => app}/jobs/dynamic_tool_destination/data/test_users.yml | 0 .../jobs/dynamic_tool_destination/data/tool_destination.yml | 0 test/unit/{ => app}/jobs/dynamic_tool_destination/mockGalaxy.py | 0 .../dynamic_tool_destination/test_dynamic_tool_destination.py | 0 test/unit/{ => app}/jobs/dynamic_tool_destination/ymltests.py | 0 test/unit/{ => app}/jobs/handler_template_job_conf.xml | 0 test/unit/{ => app}/jobs/job_conf.sample_advanced.yml | 0 test/unit/{ => app}/jobs/test_command_factory.py | 0 test/unit/{ => app}/jobs/test_expression_run.py | 0 test/unit/{ => app}/jobs/test_job_configuration.py | 0 test/unit/{ => app}/jobs/test_job_context.py | 0 test/unit/{ => app}/jobs/test_job_wrapper.py | 0 test/unit/{ => app}/jobs/test_mapper.py | 0 test/unit/{ => app}/jobs/test_rule_helper.py | 0 test/unit/{ => app}/jobs/test_rules/10_site.py | 0 test/unit/{ => app}/jobs/test_rules/20_instance.py | 0 .../test_rules_override => app/jobs/test_rules}/__init__.py | 0 test/unit/{ => app}/jobs/test_rules_override/10_rule.py | 0 .../unit/{managers => app/jobs/test_rules_override}/__init__.py | 0 test/unit/{ => app}/jobs/test_runner_local.py | 0 test/unit/{ => app}/jobs/test_runner_params.py | 0 test/unit/{tools => app/managers}/__init__.py | 0 test/unit/{ => app}/managers/base.py | 0 test/unit/{ => app}/managers/test_CollectionManager.py | 0 test/unit/{ => app}/managers/test_DatasetManager.py | 0 test/unit/{ => app}/managers/test_HDAManager.py | 0 test/unit/{ => app}/managers/test_HDCAManager.py | 0 test/unit/{ => app}/managers/test_HistoryContentsManager.py | 0 test/unit/{ => app}/managers/test_HistoryManager.py | 0 test/unit/{ => app}/managers/test_TagHandler.py | 0 test/unit/{ => app}/managers/test_UserManager.py | 0 test/unit/{ => app}/managers/test_markdown_export.py | 0 test/unit/{ => app}/managers/test_markdown_to_html.py | 0 test/unit/{ => app}/queue_worker/__init__.py | 0 test/unit/{ => app}/queue_worker/conftest.py | 0 test/unit/{ => app}/queue_worker/test_database_heartbeat.py | 0 test/unit/{ => app}/queue_worker/test_queue_worker.py | 0 test/unit/{ => app}/test_markdown_validate.py | 0 test/unit/{ => app}/test_remote_shell.py | 0 test/unit/{visualizations => app/tools}/__init__.py | 0 test/unit/{ => app}/tools/conftest.py | 0 test/unit/{ => app}/tools/test_actions.py | 0 test/unit/{ => app}/tools/test_citations.py | 0 test/unit/{ => app}/tools/test_collect_primary_datasets.py | 0 test/unit/{ => app}/tools/test_column_parameters.py | 0 test/unit/{ => app}/tools/test_data_parameters.py | 0 test/unit/{ => app}/tools/test_dataset_matcher.py | 0 test/unit/{ => app}/tools/test_evaluation.py | 0 test/unit/{ => app}/tools/test_execution.py | 0 test/unit/{ => app}/tools/test_expression_basics.py | 0 test/unit/{ => app}/tools/test_history_imp_exp.py | 0 test/unit/{ => app}/tools/test_metadata.py | 0 test/unit/{ => app}/tools/test_parameter_parsing.py | 0 test/unit/{ => app}/tools/test_select_parameters.py | 0 test/unit/{ => app}/tools/test_tool_conf_repository.py | 0 test/unit/{ => app}/tools/test_tool_dependency_description.py | 0 test/unit/{ => app}/tools/test_tool_external_files.py | 0 test/unit/{ => app}/tools/test_tool_shed_repository_cache.py | 0 test/unit/{ => app}/tools/test_tool_validation.py | 0 test/unit/{ => app}/tools/test_toolbox.py | 0 test/unit/{ => app}/tools/test_wrappers.py | 0 test/unit/{ => app}/tools/util.py | 0 test/unit/app/visualizations/__init__.py | 0 test/unit/{ => app}/visualizations/plugins/__init__.py | 0 .../visualizations/plugins/test_VisualizationPlugin.py | 0 .../visualizations/plugins/test_VisualizationsRegistry.py | 0 test/unit/files/webdav_file_sources_conf.yml | 1 - test/unit/shed_unit/test_installed_repository_manager.py | 2 +- test/unit/shed_unit/test_tool_panel_manager.py | 2 +- 95 files changed, 4 insertions(+), 3 deletions(-) create mode 120000 packages/app/tests/app rename test/unit/{authnz => app}/__init__.py (100%) rename test/unit/{files => app/authnz}/__init__.py (100%) rename test/unit/{ => app}/authnz/test_custos_authnz.py (100%) rename test/unit/{jobs => app/files}/__init__.py (100%) rename test/unit/{ => app}/files/_util.py (100%) rename test/unit/{ => app}/files/dropbox_file_sources_conf.yml (100%) create mode 120000 test/unit/app/files/file_sources_conf.yml rename test/unit/{ => app}/files/s3_file_sources_conf.yml (100%) rename test/unit/{ => app}/files/test_dropbox.py (100%) rename test/unit/{ => app}/files/test_posix.py (100%) rename test/unit/{ => app}/files/test_s3.py (100%) rename test/unit/{ => app}/files/test_webdav.py (100%) rename test/unit/{ => app}/files/webdav_user_file_sources_conf.yml (100%) rename test/unit/{jobs/dynamic_tool_destination => app/jobs}/__init__.py (100%) rename test/unit/{ => app}/jobs/conditional_runners_job_conf.xml (100%) rename test/unit/{jobs/test_rules => app/jobs/dynamic_tool_destination}/__init__.py (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/dest_fail.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/job_conf.xml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/priority_tool_destination.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test.empty (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test.fasta (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test1.full (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test3.full (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test_no_verbose.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test_num_input_datasets.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/test_users.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/data/tool_destination.yml (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/mockGalaxy.py (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py (100%) rename test/unit/{ => app}/jobs/dynamic_tool_destination/ymltests.py (100%) rename test/unit/{ => app}/jobs/handler_template_job_conf.xml (100%) rename test/unit/{ => app}/jobs/job_conf.sample_advanced.yml (100%) rename test/unit/{ => app}/jobs/test_command_factory.py (100%) rename test/unit/{ => app}/jobs/test_expression_run.py (100%) rename test/unit/{ => app}/jobs/test_job_configuration.py (100%) rename test/unit/{ => app}/jobs/test_job_context.py (100%) rename test/unit/{ => app}/jobs/test_job_wrapper.py (100%) rename test/unit/{ => app}/jobs/test_mapper.py (100%) rename test/unit/{ => app}/jobs/test_rule_helper.py (100%) rename test/unit/{ => app}/jobs/test_rules/10_site.py (100%) rename test/unit/{ => app}/jobs/test_rules/20_instance.py (100%) rename test/unit/{jobs/test_rules_override => app/jobs/test_rules}/__init__.py (100%) rename test/unit/{ => app}/jobs/test_rules_override/10_rule.py (100%) rename test/unit/{managers => app/jobs/test_rules_override}/__init__.py (100%) rename test/unit/{ => app}/jobs/test_runner_local.py (100%) rename test/unit/{ => app}/jobs/test_runner_params.py (100%) rename test/unit/{tools => app/managers}/__init__.py (100%) rename test/unit/{ => app}/managers/base.py (100%) rename test/unit/{ => app}/managers/test_CollectionManager.py (100%) rename test/unit/{ => app}/managers/test_DatasetManager.py (100%) rename test/unit/{ => app}/managers/test_HDAManager.py (100%) rename test/unit/{ => app}/managers/test_HDCAManager.py (100%) rename test/unit/{ => app}/managers/test_HistoryContentsManager.py (100%) rename test/unit/{ => app}/managers/test_HistoryManager.py (100%) rename test/unit/{ => app}/managers/test_TagHandler.py (100%) rename test/unit/{ => app}/managers/test_UserManager.py (100%) rename test/unit/{ => app}/managers/test_markdown_export.py (100%) rename test/unit/{ => app}/managers/test_markdown_to_html.py (100%) rename test/unit/{ => app}/queue_worker/__init__.py (100%) rename test/unit/{ => app}/queue_worker/conftest.py (100%) rename test/unit/{ => app}/queue_worker/test_database_heartbeat.py (100%) rename test/unit/{ => app}/queue_worker/test_queue_worker.py (100%) rename test/unit/{ => app}/test_markdown_validate.py (100%) rename test/unit/{ => app}/test_remote_shell.py (100%) rename test/unit/{visualizations => app/tools}/__init__.py (100%) rename test/unit/{ => app}/tools/conftest.py (100%) rename test/unit/{ => app}/tools/test_actions.py (100%) rename test/unit/{ => app}/tools/test_citations.py (100%) rename test/unit/{ => app}/tools/test_collect_primary_datasets.py (100%) rename test/unit/{ => app}/tools/test_column_parameters.py (100%) rename test/unit/{ => app}/tools/test_data_parameters.py (100%) rename test/unit/{ => app}/tools/test_dataset_matcher.py (100%) rename test/unit/{ => app}/tools/test_evaluation.py (100%) rename test/unit/{ => app}/tools/test_execution.py (100%) rename test/unit/{ => app}/tools/test_expression_basics.py (100%) rename test/unit/{ => app}/tools/test_history_imp_exp.py (100%) rename test/unit/{ => app}/tools/test_metadata.py (100%) rename test/unit/{ => app}/tools/test_parameter_parsing.py (100%) rename test/unit/{ => app}/tools/test_select_parameters.py (100%) rename test/unit/{ => app}/tools/test_tool_conf_repository.py (100%) rename test/unit/{ => app}/tools/test_tool_dependency_description.py (100%) rename test/unit/{ => app}/tools/test_tool_external_files.py (100%) rename test/unit/{ => app}/tools/test_tool_shed_repository_cache.py (100%) rename test/unit/{ => app}/tools/test_tool_validation.py (100%) rename test/unit/{ => app}/tools/test_toolbox.py (100%) rename test/unit/{ => app}/tools/test_wrappers.py (100%) rename test/unit/{ => app}/tools/util.py (100%) create mode 100644 test/unit/app/visualizations/__init__.py rename test/unit/{ => app}/visualizations/plugins/__init__.py (100%) rename test/unit/{ => app}/visualizations/plugins/test_VisualizationPlugin.py (100%) rename test/unit/{ => app}/visualizations/plugins/test_VisualizationsRegistry.py (100%) delete mode 120000 test/unit/files/webdav_file_sources_conf.yml diff --git a/packages/app/tests/app b/packages/app/tests/app new file mode 120000 index 00000000000..a95464c4b30 --- /dev/null +++ b/packages/app/tests/app @@ -0,0 +1 @@ +../../../test/unit/app/ \ No newline at end of file diff --git a/test/unit/authnz/__init__.py b/test/unit/app/__init__.py similarity index 100% rename from test/unit/authnz/__init__.py rename to test/unit/app/__init__.py diff --git a/test/unit/files/__init__.py b/test/unit/app/authnz/__init__.py similarity index 100% rename from test/unit/files/__init__.py rename to test/unit/app/authnz/__init__.py diff --git a/test/unit/authnz/test_custos_authnz.py b/test/unit/app/authnz/test_custos_authnz.py similarity index 100% rename from test/unit/authnz/test_custos_authnz.py rename to test/unit/app/authnz/test_custos_authnz.py diff --git a/test/unit/jobs/__init__.py b/test/unit/app/files/__init__.py similarity index 100% rename from test/unit/jobs/__init__.py rename to test/unit/app/files/__init__.py diff --git a/test/unit/files/_util.py b/test/unit/app/files/_util.py similarity index 100% rename from test/unit/files/_util.py rename to test/unit/app/files/_util.py diff --git a/test/unit/files/dropbox_file_sources_conf.yml b/test/unit/app/files/dropbox_file_sources_conf.yml similarity index 100% rename from test/unit/files/dropbox_file_sources_conf.yml rename to test/unit/app/files/dropbox_file_sources_conf.yml diff --git a/test/unit/app/files/file_sources_conf.yml b/test/unit/app/files/file_sources_conf.yml new file mode 120000 index 00000000000..b021797364f --- /dev/null +++ b/test/unit/app/files/file_sources_conf.yml @@ -0,0 +1 @@ +../../../integration/file_sources_conf.yml \ No newline at end of file diff --git a/test/unit/files/s3_file_sources_conf.yml b/test/unit/app/files/s3_file_sources_conf.yml similarity index 100% rename from test/unit/files/s3_file_sources_conf.yml rename to test/unit/app/files/s3_file_sources_conf.yml diff --git a/test/unit/files/test_dropbox.py b/test/unit/app/files/test_dropbox.py similarity index 100% rename from test/unit/files/test_dropbox.py rename to test/unit/app/files/test_dropbox.py diff --git a/test/unit/files/test_posix.py b/test/unit/app/files/test_posix.py similarity index 100% rename from test/unit/files/test_posix.py rename to test/unit/app/files/test_posix.py diff --git a/test/unit/files/test_s3.py b/test/unit/app/files/test_s3.py similarity index 100% rename from test/unit/files/test_s3.py rename to test/unit/app/files/test_s3.py diff --git a/test/unit/files/test_webdav.py b/test/unit/app/files/test_webdav.py similarity index 100% rename from test/unit/files/test_webdav.py rename to test/unit/app/files/test_webdav.py diff --git a/test/unit/files/webdav_user_file_sources_conf.yml b/test/unit/app/files/webdav_user_file_sources_conf.yml similarity index 100% rename from test/unit/files/webdav_user_file_sources_conf.yml rename to test/unit/app/files/webdav_user_file_sources_conf.yml diff --git a/test/unit/jobs/dynamic_tool_destination/__init__.py b/test/unit/app/jobs/__init__.py similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/__init__.py rename to test/unit/app/jobs/__init__.py diff --git a/test/unit/jobs/conditional_runners_job_conf.xml b/test/unit/app/jobs/conditional_runners_job_conf.xml similarity index 100% rename from test/unit/jobs/conditional_runners_job_conf.xml rename to test/unit/app/jobs/conditional_runners_job_conf.xml diff --git a/test/unit/jobs/test_rules/__init__.py b/test/unit/app/jobs/dynamic_tool_destination/__init__.py similarity index 100% rename from test/unit/jobs/test_rules/__init__.py rename to test/unit/app/jobs/dynamic_tool_destination/__init__.py diff --git a/test/unit/jobs/dynamic_tool_destination/data/dest_fail.yml b/test/unit/app/jobs/dynamic_tool_destination/data/dest_fail.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/dest_fail.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/dest_fail.yml diff --git a/test/unit/jobs/dynamic_tool_destination/data/job_conf.xml b/test/unit/app/jobs/dynamic_tool_destination/data/job_conf.xml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/job_conf.xml rename to test/unit/app/jobs/dynamic_tool_destination/data/job_conf.xml diff --git a/test/unit/jobs/dynamic_tool_destination/data/priority_tool_destination.yml b/test/unit/app/jobs/dynamic_tool_destination/data/priority_tool_destination.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/priority_tool_destination.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/priority_tool_destination.yml diff --git a/test/unit/jobs/dynamic_tool_destination/data/test.empty b/test/unit/app/jobs/dynamic_tool_destination/data/test.empty similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test.empty rename to test/unit/app/jobs/dynamic_tool_destination/data/test.empty diff --git a/test/unit/jobs/dynamic_tool_destination/data/test.fasta b/test/unit/app/jobs/dynamic_tool_destination/data/test.fasta similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test.fasta rename to test/unit/app/jobs/dynamic_tool_destination/data/test.fasta diff --git a/test/unit/jobs/dynamic_tool_destination/data/test1.full b/test/unit/app/jobs/dynamic_tool_destination/data/test1.full similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test1.full rename to test/unit/app/jobs/dynamic_tool_destination/data/test1.full diff --git a/test/unit/jobs/dynamic_tool_destination/data/test3.full b/test/unit/app/jobs/dynamic_tool_destination/data/test3.full similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test3.full rename to test/unit/app/jobs/dynamic_tool_destination/data/test3.full diff --git a/test/unit/jobs/dynamic_tool_destination/data/test_no_verbose.yml b/test/unit/app/jobs/dynamic_tool_destination/data/test_no_verbose.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test_no_verbose.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/test_no_verbose.yml diff --git a/test/unit/jobs/dynamic_tool_destination/data/test_num_input_datasets.yml b/test/unit/app/jobs/dynamic_tool_destination/data/test_num_input_datasets.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test_num_input_datasets.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/test_num_input_datasets.yml diff --git a/test/unit/jobs/dynamic_tool_destination/data/test_users.yml b/test/unit/app/jobs/dynamic_tool_destination/data/test_users.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/test_users.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/test_users.yml diff --git a/test/unit/jobs/dynamic_tool_destination/data/tool_destination.yml b/test/unit/app/jobs/dynamic_tool_destination/data/tool_destination.yml similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/data/tool_destination.yml rename to test/unit/app/jobs/dynamic_tool_destination/data/tool_destination.yml diff --git a/test/unit/jobs/dynamic_tool_destination/mockGalaxy.py b/test/unit/app/jobs/dynamic_tool_destination/mockGalaxy.py similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/mockGalaxy.py rename to test/unit/app/jobs/dynamic_tool_destination/mockGalaxy.py diff --git a/test/unit/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py b/test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py rename to test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py diff --git a/test/unit/jobs/dynamic_tool_destination/ymltests.py b/test/unit/app/jobs/dynamic_tool_destination/ymltests.py similarity index 100% rename from test/unit/jobs/dynamic_tool_destination/ymltests.py rename to test/unit/app/jobs/dynamic_tool_destination/ymltests.py diff --git a/test/unit/jobs/handler_template_job_conf.xml b/test/unit/app/jobs/handler_template_job_conf.xml similarity index 100% rename from test/unit/jobs/handler_template_job_conf.xml rename to test/unit/app/jobs/handler_template_job_conf.xml diff --git a/test/unit/jobs/job_conf.sample_advanced.yml b/test/unit/app/jobs/job_conf.sample_advanced.yml similarity index 100% rename from test/unit/jobs/job_conf.sample_advanced.yml rename to test/unit/app/jobs/job_conf.sample_advanced.yml diff --git a/test/unit/jobs/test_command_factory.py b/test/unit/app/jobs/test_command_factory.py similarity index 100% rename from test/unit/jobs/test_command_factory.py rename to test/unit/app/jobs/test_command_factory.py diff --git a/test/unit/jobs/test_expression_run.py b/test/unit/app/jobs/test_expression_run.py similarity index 100% rename from test/unit/jobs/test_expression_run.py rename to test/unit/app/jobs/test_expression_run.py diff --git a/test/unit/jobs/test_job_configuration.py b/test/unit/app/jobs/test_job_configuration.py similarity index 100% rename from test/unit/jobs/test_job_configuration.py rename to test/unit/app/jobs/test_job_configuration.py diff --git a/test/unit/jobs/test_job_context.py b/test/unit/app/jobs/test_job_context.py similarity index 100% rename from test/unit/jobs/test_job_context.py rename to test/unit/app/jobs/test_job_context.py diff --git a/test/unit/jobs/test_job_wrapper.py b/test/unit/app/jobs/test_job_wrapper.py similarity index 100% rename from test/unit/jobs/test_job_wrapper.py rename to test/unit/app/jobs/test_job_wrapper.py diff --git a/test/unit/jobs/test_mapper.py b/test/unit/app/jobs/test_mapper.py similarity index 100% rename from test/unit/jobs/test_mapper.py rename to test/unit/app/jobs/test_mapper.py diff --git a/test/unit/jobs/test_rule_helper.py b/test/unit/app/jobs/test_rule_helper.py similarity index 100% rename from test/unit/jobs/test_rule_helper.py rename to test/unit/app/jobs/test_rule_helper.py diff --git a/test/unit/jobs/test_rules/10_site.py b/test/unit/app/jobs/test_rules/10_site.py similarity index 100% rename from test/unit/jobs/test_rules/10_site.py rename to test/unit/app/jobs/test_rules/10_site.py diff --git a/test/unit/jobs/test_rules/20_instance.py b/test/unit/app/jobs/test_rules/20_instance.py similarity index 100% rename from test/unit/jobs/test_rules/20_instance.py rename to test/unit/app/jobs/test_rules/20_instance.py diff --git a/test/unit/jobs/test_rules_override/__init__.py b/test/unit/app/jobs/test_rules/__init__.py similarity index 100% rename from test/unit/jobs/test_rules_override/__init__.py rename to test/unit/app/jobs/test_rules/__init__.py diff --git a/test/unit/jobs/test_rules_override/10_rule.py b/test/unit/app/jobs/test_rules_override/10_rule.py similarity index 100% rename from test/unit/jobs/test_rules_override/10_rule.py rename to test/unit/app/jobs/test_rules_override/10_rule.py diff --git a/test/unit/managers/__init__.py b/test/unit/app/jobs/test_rules_override/__init__.py similarity index 100% rename from test/unit/managers/__init__.py rename to test/unit/app/jobs/test_rules_override/__init__.py diff --git a/test/unit/jobs/test_runner_local.py b/test/unit/app/jobs/test_runner_local.py similarity index 100% rename from test/unit/jobs/test_runner_local.py rename to test/unit/app/jobs/test_runner_local.py diff --git a/test/unit/jobs/test_runner_params.py b/test/unit/app/jobs/test_runner_params.py similarity index 100% rename from test/unit/jobs/test_runner_params.py rename to test/unit/app/jobs/test_runner_params.py diff --git a/test/unit/tools/__init__.py b/test/unit/app/managers/__init__.py similarity index 100% rename from test/unit/tools/__init__.py rename to test/unit/app/managers/__init__.py diff --git a/test/unit/managers/base.py b/test/unit/app/managers/base.py similarity index 100% rename from test/unit/managers/base.py rename to test/unit/app/managers/base.py diff --git a/test/unit/managers/test_CollectionManager.py b/test/unit/app/managers/test_CollectionManager.py similarity index 100% rename from test/unit/managers/test_CollectionManager.py rename to test/unit/app/managers/test_CollectionManager.py diff --git a/test/unit/managers/test_DatasetManager.py b/test/unit/app/managers/test_DatasetManager.py similarity index 100% rename from test/unit/managers/test_DatasetManager.py rename to test/unit/app/managers/test_DatasetManager.py diff --git a/test/unit/managers/test_HDAManager.py b/test/unit/app/managers/test_HDAManager.py similarity index 100% rename from test/unit/managers/test_HDAManager.py rename to test/unit/app/managers/test_HDAManager.py diff --git a/test/unit/managers/test_HDCAManager.py b/test/unit/app/managers/test_HDCAManager.py similarity index 100% rename from test/unit/managers/test_HDCAManager.py rename to test/unit/app/managers/test_HDCAManager.py diff --git a/test/unit/managers/test_HistoryContentsManager.py b/test/unit/app/managers/test_HistoryContentsManager.py similarity index 100% rename from test/unit/managers/test_HistoryContentsManager.py rename to test/unit/app/managers/test_HistoryContentsManager.py diff --git a/test/unit/managers/test_HistoryManager.py b/test/unit/app/managers/test_HistoryManager.py similarity index 100% rename from test/unit/managers/test_HistoryManager.py rename to test/unit/app/managers/test_HistoryManager.py diff --git a/test/unit/managers/test_TagHandler.py b/test/unit/app/managers/test_TagHandler.py similarity index 100% rename from test/unit/managers/test_TagHandler.py rename to test/unit/app/managers/test_TagHandler.py diff --git a/test/unit/managers/test_UserManager.py b/test/unit/app/managers/test_UserManager.py similarity index 100% rename from test/unit/managers/test_UserManager.py rename to test/unit/app/managers/test_UserManager.py diff --git a/test/unit/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py similarity index 100% rename from test/unit/managers/test_markdown_export.py rename to test/unit/app/managers/test_markdown_export.py diff --git a/test/unit/managers/test_markdown_to_html.py b/test/unit/app/managers/test_markdown_to_html.py similarity index 100% rename from test/unit/managers/test_markdown_to_html.py rename to test/unit/app/managers/test_markdown_to_html.py diff --git a/test/unit/queue_worker/__init__.py b/test/unit/app/queue_worker/__init__.py similarity index 100% rename from test/unit/queue_worker/__init__.py rename to test/unit/app/queue_worker/__init__.py diff --git a/test/unit/queue_worker/conftest.py b/test/unit/app/queue_worker/conftest.py similarity index 100% rename from test/unit/queue_worker/conftest.py rename to test/unit/app/queue_worker/conftest.py diff --git a/test/unit/queue_worker/test_database_heartbeat.py b/test/unit/app/queue_worker/test_database_heartbeat.py similarity index 100% rename from test/unit/queue_worker/test_database_heartbeat.py rename to test/unit/app/queue_worker/test_database_heartbeat.py diff --git a/test/unit/queue_worker/test_queue_worker.py b/test/unit/app/queue_worker/test_queue_worker.py similarity index 100% rename from test/unit/queue_worker/test_queue_worker.py rename to test/unit/app/queue_worker/test_queue_worker.py diff --git a/test/unit/test_markdown_validate.py b/test/unit/app/test_markdown_validate.py similarity index 100% rename from test/unit/test_markdown_validate.py rename to test/unit/app/test_markdown_validate.py diff --git a/test/unit/test_remote_shell.py b/test/unit/app/test_remote_shell.py similarity index 100% rename from test/unit/test_remote_shell.py rename to test/unit/app/test_remote_shell.py diff --git a/test/unit/visualizations/__init__.py b/test/unit/app/tools/__init__.py similarity index 100% rename from test/unit/visualizations/__init__.py rename to test/unit/app/tools/__init__.py diff --git a/test/unit/tools/conftest.py b/test/unit/app/tools/conftest.py similarity index 100% rename from test/unit/tools/conftest.py rename to test/unit/app/tools/conftest.py diff --git a/test/unit/tools/test_actions.py b/test/unit/app/tools/test_actions.py similarity index 100% rename from test/unit/tools/test_actions.py rename to test/unit/app/tools/test_actions.py diff --git a/test/unit/tools/test_citations.py b/test/unit/app/tools/test_citations.py similarity index 100% rename from test/unit/tools/test_citations.py rename to test/unit/app/tools/test_citations.py diff --git a/test/unit/tools/test_collect_primary_datasets.py b/test/unit/app/tools/test_collect_primary_datasets.py similarity index 100% rename from test/unit/tools/test_collect_primary_datasets.py rename to test/unit/app/tools/test_collect_primary_datasets.py diff --git a/test/unit/tools/test_column_parameters.py b/test/unit/app/tools/test_column_parameters.py similarity index 100% rename from test/unit/tools/test_column_parameters.py rename to test/unit/app/tools/test_column_parameters.py diff --git a/test/unit/tools/test_data_parameters.py b/test/unit/app/tools/test_data_parameters.py similarity index 100% rename from test/unit/tools/test_data_parameters.py rename to test/unit/app/tools/test_data_parameters.py diff --git a/test/unit/tools/test_dataset_matcher.py b/test/unit/app/tools/test_dataset_matcher.py similarity index 100% rename from test/unit/tools/test_dataset_matcher.py rename to test/unit/app/tools/test_dataset_matcher.py diff --git a/test/unit/tools/test_evaluation.py b/test/unit/app/tools/test_evaluation.py similarity index 100% rename from test/unit/tools/test_evaluation.py rename to test/unit/app/tools/test_evaluation.py diff --git a/test/unit/tools/test_execution.py b/test/unit/app/tools/test_execution.py similarity index 100% rename from test/unit/tools/test_execution.py rename to test/unit/app/tools/test_execution.py diff --git a/test/unit/tools/test_expression_basics.py b/test/unit/app/tools/test_expression_basics.py similarity index 100% rename from test/unit/tools/test_expression_basics.py rename to test/unit/app/tools/test_expression_basics.py diff --git a/test/unit/tools/test_history_imp_exp.py b/test/unit/app/tools/test_history_imp_exp.py similarity index 100% rename from test/unit/tools/test_history_imp_exp.py rename to test/unit/app/tools/test_history_imp_exp.py diff --git a/test/unit/tools/test_metadata.py b/test/unit/app/tools/test_metadata.py similarity index 100% rename from test/unit/tools/test_metadata.py rename to test/unit/app/tools/test_metadata.py diff --git a/test/unit/tools/test_parameter_parsing.py b/test/unit/app/tools/test_parameter_parsing.py similarity index 100% rename from test/unit/tools/test_parameter_parsing.py rename to test/unit/app/tools/test_parameter_parsing.py diff --git a/test/unit/tools/test_select_parameters.py b/test/unit/app/tools/test_select_parameters.py similarity index 100% rename from test/unit/tools/test_select_parameters.py rename to test/unit/app/tools/test_select_parameters.py diff --git a/test/unit/tools/test_tool_conf_repository.py b/test/unit/app/tools/test_tool_conf_repository.py similarity index 100% rename from test/unit/tools/test_tool_conf_repository.py rename to test/unit/app/tools/test_tool_conf_repository.py diff --git a/test/unit/tools/test_tool_dependency_description.py b/test/unit/app/tools/test_tool_dependency_description.py similarity index 100% rename from test/unit/tools/test_tool_dependency_description.py rename to test/unit/app/tools/test_tool_dependency_description.py diff --git a/test/unit/tools/test_tool_external_files.py b/test/unit/app/tools/test_tool_external_files.py similarity index 100% rename from test/unit/tools/test_tool_external_files.py rename to test/unit/app/tools/test_tool_external_files.py diff --git a/test/unit/tools/test_tool_shed_repository_cache.py b/test/unit/app/tools/test_tool_shed_repository_cache.py similarity index 100% rename from test/unit/tools/test_tool_shed_repository_cache.py rename to test/unit/app/tools/test_tool_shed_repository_cache.py diff --git a/test/unit/tools/test_tool_validation.py b/test/unit/app/tools/test_tool_validation.py similarity index 100% rename from test/unit/tools/test_tool_validation.py rename to test/unit/app/tools/test_tool_validation.py diff --git a/test/unit/tools/test_toolbox.py b/test/unit/app/tools/test_toolbox.py similarity index 100% rename from test/unit/tools/test_toolbox.py rename to test/unit/app/tools/test_toolbox.py diff --git a/test/unit/tools/test_wrappers.py b/test/unit/app/tools/test_wrappers.py similarity index 100% rename from test/unit/tools/test_wrappers.py rename to test/unit/app/tools/test_wrappers.py diff --git a/test/unit/tools/util.py b/test/unit/app/tools/util.py similarity index 100% rename from test/unit/tools/util.py rename to test/unit/app/tools/util.py diff --git a/test/unit/app/visualizations/__init__.py b/test/unit/app/visualizations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/unit/visualizations/plugins/__init__.py b/test/unit/app/visualizations/plugins/__init__.py similarity index 100% rename from test/unit/visualizations/plugins/__init__.py rename to test/unit/app/visualizations/plugins/__init__.py diff --git a/test/unit/visualizations/plugins/test_VisualizationPlugin.py b/test/unit/app/visualizations/plugins/test_VisualizationPlugin.py similarity index 100% rename from test/unit/visualizations/plugins/test_VisualizationPlugin.py rename to test/unit/app/visualizations/plugins/test_VisualizationPlugin.py diff --git a/test/unit/visualizations/plugins/test_VisualizationsRegistry.py b/test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py similarity index 100% rename from test/unit/visualizations/plugins/test_VisualizationsRegistry.py rename to test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py diff --git a/test/unit/files/webdav_file_sources_conf.yml b/test/unit/files/webdav_file_sources_conf.yml deleted file mode 120000 index 12e2e0e3cbf..00000000000 --- a/test/unit/files/webdav_file_sources_conf.yml +++ /dev/null @@ -1 +0,0 @@ -../../integration/file_sources_conf.yml \ No newline at end of file diff --git a/test/unit/shed_unit/test_installed_repository_manager.py b/test/unit/shed_unit/test_installed_repository_manager.py index 9c31225ae78..9b3393ea802 100644 --- a/test/unit/shed_unit/test_installed_repository_manager.py +++ b/test/unit/shed_unit/test_installed_repository_manager.py @@ -9,7 +9,7 @@ from galaxy.tool_shed.util import ( repository_util, ) from galaxy.util.tool_shed import common_util -from ..tools.test_toolbox import ( +from ..app.tools.test_toolbox import ( BaseToolBoxTestCase, DEFAULT_TEST_REPO ) diff --git a/test/unit/shed_unit/test_tool_panel_manager.py b/test/unit/shed_unit/test_tool_panel_manager.py index 7c31c3ad6f7..420e5ea12e2 100644 --- a/test/unit/shed_unit/test_tool_panel_manager.py +++ b/test/unit/shed_unit/test_tool_panel_manager.py @@ -3,7 +3,7 @@ import os from galaxy.tool_shed.galaxy_install.tools import tool_panel_manager from galaxy.util import parse_xml from tool_shed.tools import tool_version_manager -from ..tools.test_toolbox import ( +from ..app.tools.test_toolbox import ( BaseToolBoxTestCase, SimplifiedToolBox ) From c3bdef82c85f25b5ef8af28bdd8d320a84a5a82b Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 26 Sep 2021 17:56:44 -0400 Subject: [PATCH 04/14] Fixup galaxy-app's dependencies and packages. --- packages/app/setup.py | 2 ++ packages/app/test-requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/app/setup.py b/packages/app/setup.py index df901be5079..819388e2492 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -33,7 +33,9 @@ PACKAGES = [ 'galaxy', 'galaxy.actions', 'galaxy.app_unittest_utils', + 'galaxy.authnz', 'galaxy.config', + 'galaxy.dependencies', 'galaxy.files', 'galaxy.files.sources', 'galaxy.forms', diff --git a/packages/app/test-requirements.txt b/packages/app/test-requirements.txt index e079f8a6038..6565ec31f09 100644 --- a/packages/app/test-requirements.txt +++ b/packages/app/test-requirements.txt @@ -1 +1,2 @@ pytest +testfixtures From 528e3e45276b70bcd185e2b980dff0b08293f8d7 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 26 Sep 2021 18:16:46 -0400 Subject: [PATCH 05/14] Move controller testing out of manager test suite. --- test/unit/app/managers/base.py | 3 - test/unit/app/managers/test_UserManager.py | 30 +--------- test/unit/webapps/test_login.py | 69 ++++++++++++++++++++++ 3 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 test/unit/webapps/test_login.py diff --git a/test/unit/app/managers/base.py b/test/unit/app/managers/base.py index d3ecbddcb44..13368ccc370 100644 --- a/test/unit/app/managers/base.py +++ b/test/unit/app/managers/base.py @@ -26,9 +26,6 @@ class BaseTestCase(unittest.TestCase): def tearDownClass(cls): print('\n', '-' * 20, 'end class', cls) - def __init__(self, *args): - unittest.TestCase.__init__(self, *args) - def setUp(self): self.log('.' * 20, 'begin test', self) self.set_up_mocks() diff --git a/test/unit/app/managers/test_UserManager.py b/test/unit/app/managers/test_UserManager.py index df08bcfc3dc..05f16869687 100644 --- a/test/unit/app/managers/test_UserManager.py +++ b/test/unit/app/managers/test_UserManager.py @@ -3,9 +3,8 @@ User Manager testing. Executable directly using: python -m test.unit.managers.test_UserManager """ -import json import unittest -from datetime import datetime, timedelta +from datetime import datetime from sqlalchemy import desc @@ -13,7 +12,6 @@ from galaxy import exceptions, model from galaxy.managers import base as base_manager from galaxy.managers import histories, users from galaxy.security.passwords import check_password -from galaxy.webapps.galaxy.controllers.user import User from .base import BaseTestCase @@ -139,32 +137,6 @@ class UserManagerTestCase(BaseTestCase): self.assertIsNotNone(user2.id) self.assertEqual(user2.email, user2_data["email"]) self.assertTrue(check_password(default_password, user2.password)) - controller = User(self.app) - response = json.loads(controller.login(self.trans)) - self.assertEqual(response["err_msg"], "Please specify a username and password.") - response = json.loads(controller.login(self.trans, payload={"login": user2.email, "password": changed_password})) - self.assertEqual(response["err_msg"], "Invalid password.") - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": changed_password})) - self.assertEqual(response["err_msg"], "Invalid password.") - user2.deleted = True - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) - self.assertEqual(response["err_msg"], "This account has been marked deleted, contact your local Galaxy administrator to restore the account. Contact: admin@email.to.") - user2.deleted = False - user2.external = True - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) - self.assertEqual(response["err_msg"], "This account was created for use with an external authentication method, contact your local Galaxy administrator to activate it. Contact: admin@email.to.") - user2.external = False - self.trans.app.config.password_expiration_period = timedelta(days=1) - user2.last_password_change = datetime.today() - timedelta(days=1) - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) - self.assertEqual(response["message"], "Your password has expired. Please reset or change it to access Galaxy.") - self.assertEqual(response["expired_user"], self.trans.security.encode_id(user2.id)) - self.trans.app.config.password_expiration_period = timedelta(days=10) - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) - self.assertEqual(response["message"], "Your password will expire in 11 day(s).") - self.trans.app.config.password_expiration_period = timedelta(days=100) - response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) - self.assertEqual(response["message"], "Success.") def test_empty_password(self): self.log("should be able to create a user with no password") diff --git a/test/unit/webapps/test_login.py b/test/unit/webapps/test_login.py new file mode 100644 index 00000000000..6218d077144 --- /dev/null +++ b/test/unit/webapps/test_login.py @@ -0,0 +1,69 @@ +import json +from datetime import datetime, timedelta +from unittest import TestCase + +from galaxy import model +from galaxy.app_unittest_utils import galaxy_mock +from galaxy.managers.users import UserManager +from galaxy.security.passwords import check_password +from galaxy.webapps.galaxy.controllers.user import User + +admin_email = 'admin@admin.admin' +admin_users = admin_email +default_password = '123456' +changed_password = '654321' +user2_data = dict(email='user2@user2.user2', username='user2', password=default_password) + + +class LoginControllerTestCase(TestCase): + + def setUp(self): + admin_users_list = [u for u in admin_users.split(',') if u] + self.trans = galaxy_mock.MockTrans(admin_users=admin_users, admin_users_list=admin_users_list) + self.app = self.trans.app + + def mock_is_admin_user(user): + return user.email in admin_users + + self.trans.app.config.is_admin_user = mock_is_admin_user + + self.user_manager = self.app[UserManager] + + self.admin_user = self.user_manager.create(email=admin_email, username='admin', password=default_password) + self.trans.set_user(self.admin_user) + self.trans.set_history(None) + + def test_login(self): + user2 = self.user_manager.create(**user2_data) + self.app.security.encode_id(user2.id) + self.assertIsInstance(user2, model.User) + self.assertIsNotNone(user2.id) + self.assertEqual(user2.email, user2_data["email"]) + self.assertTrue(check_password(default_password, user2.password)) + + controller = User(self.app) + response = json.loads(controller.login(self.trans)) + self.assertEqual(response["err_msg"], "Please specify a username and password.") + response = json.loads(controller.login(self.trans, payload={"login": user2.email, "password": changed_password})) + self.assertEqual(response["err_msg"], "Invalid password.") + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": changed_password})) + self.assertEqual(response["err_msg"], "Invalid password.") + user2.deleted = True + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) + self.assertEqual(response["err_msg"], "This account has been marked deleted, contact your local Galaxy administrator to restore the account. Contact: admin@email.to.") + user2.deleted = False + user2.external = True + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) + self.assertEqual(response["err_msg"], "This account was created for use with an external authentication method, contact your local Galaxy administrator to activate it. Contact: admin@email.to.") + user2.external = False + self.trans.app.config.password_expiration_period = timedelta(days=1) + user2.last_password_change = datetime.today() - timedelta(days=1) + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) + self.assertEqual(response["message"], "Your password has expired. Please reset or change it to access Galaxy.") + self.assertEqual(response["expired_user"], self.trans.security.encode_id(user2.id)) + self.trans.app.config.password_expiration_period = timedelta(days=10) + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) + self.assertEqual(response["message"], "Your password will expire in 11 day(s).") + self.trans.app.config.password_expiration_period = timedelta(days=100) + response = json.loads(controller.login(self.trans, payload={"login": user2.username, "password": default_password})) + self.assertEqual(response["message"], "Success.") From b1e582b6c49201bae01fe87a2d57f12752e070b7 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 09:00:49 -0400 Subject: [PATCH 06/14] Add missing links to modules in galaxy-app's project structure. --- packages/app/galaxy/authnz | 1 + packages/app/galaxy/dependencies | 1 + 2 files changed, 2 insertions(+) create mode 120000 packages/app/galaxy/authnz create mode 120000 packages/app/galaxy/dependencies diff --git a/packages/app/galaxy/authnz b/packages/app/galaxy/authnz new file mode 120000 index 00000000000..c72c477258b --- /dev/null +++ b/packages/app/galaxy/authnz @@ -0,0 +1 @@ +../../../lib/galaxy/authnz/ \ No newline at end of file diff --git a/packages/app/galaxy/dependencies b/packages/app/galaxy/dependencies new file mode 120000 index 00000000000..18646f52839 --- /dev/null +++ b/packages/app/galaxy/dependencies @@ -0,0 +1 @@ +../../../lib/galaxy/dependencies/ \ No newline at end of file From 6a24f2dc7deafdc2279be7f560a6cbc0bbf0c725 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 10:33:28 -0400 Subject: [PATCH 07/14] More galaxy-app setup.py package structure fixes. --- packages/app/requirements.txt | 1 + packages/app/setup.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/app/requirements.txt b/packages/app/requirements.txt index 67d71a8e1c7..e96238b51f1 100644 --- a/packages/app/requirements.txt +++ b/packages/app/requirements.txt @@ -6,6 +6,7 @@ galaxy-web-framework galaxy-web-stack celery +cloudauthz==0.6.0 kombu Beaker pykwalify diff --git a/packages/app/setup.py b/packages/app/setup.py index 819388e2492..32859144167 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -102,6 +102,9 @@ ENTRY_POINTS = ''' PACKAGE_DATA = { # Be sure to update MANIFEST.in for source dist. 'galaxy': [ + 'config_schema.yml', + 'job_config_schema.yml', + 'uwsgi_schema.yml', ], 'tool_shed': [ 'scripts/bootstrap_tool_shed/user_info.xml', From a09788c8e32a092e7a077228602bc08902ccc102 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 11:24:13 -0400 Subject: [PATCH 08/14] More packaged unit test data fixes. --- packages/app/setup.py | 1 + test/unit/app/tools/test_history_imp_exp.py | 25 ++++++++++++--------- test/unit/app/tools/test_metadata.py | 10 ++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/app/setup.py b/packages/app/setup.py index 32859144167..52605e3b79d 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -105,6 +105,7 @@ PACKAGE_DATA = { 'config_schema.yml', 'job_config_schema.yml', 'uwsgi_schema.yml', + 'config/sample/*', ], 'tool_shed': [ 'scripts/bootstrap_tool_shed/user_info.xml', diff --git a/test/unit/app/tools/test_history_imp_exp.py b/test/unit/app/tools/test_history_imp_exp.py index a83ab4f1204..13d5a08132c 100644 --- a/test/unit/app/tools/test_history_imp_exp.py +++ b/test/unit/app/tools/test_history_imp_exp.py @@ -12,6 +12,7 @@ from galaxy.objectstore.unittest_utils import ( ) from galaxy.tools.imp_exp import JobExportHistoryArchiveWrapper, JobImportHistoryArchiveWrapper, unpack_tar_gz_archive from galaxy.tools.imp_exp.export_history import create_archive +from galaxy.util import galaxy_directory # good enough for the very specific tests we're writing as of now... @@ -22,6 +23,10 @@ HISTORY_ATTRS = '''{"hid_counter": 2, "update_time": "2016-02-08 18:38:38.705058 JOBS_ATTRS = '''[{"info": null, "tool_id": "upload1", "update_time": "2016-02-08T18:39:23.356482", "stdout": "", "input_mapping": {}, "tool_version": "1.1.4", "traceback": null, "command_line": "python /galaxy/tools/data_source/upload.py /galaxy /scratch/tmppwU9rD /scratch/tmpP4_45Y 1:/scratch/jobs/000/dataset_1_files:/data/000/dataset_1.dat", "exit_code": 0, "output_datasets": [1], "state": "ok", "create_time": "2016-02-08T18:38:39.153873", "params": {"files": [{"to_posix_lines": "Yes", "NAME": "None", "file_data": null, "space_to_tab": null, "url_paste": "/scratch/strio_url_paste_o6nrv8", "__index__": 0, "ftp_files": "", "uuid": "None"}], "paramfile": "/scratch/tmpP4_45Y", "file_type": "auto", "files_metadata": {"file_type": "auto", "__current_case__": 41}, "async_datasets": "None", "dbkey": "?"}, "stderr": ""}]''' +def t_data_path(name): + return os.path.join(galaxy_directory(), "test-data", name) + + def _run_jihaw_cleanup(archive_dir, app=None): app = app or _mock_app() job = model.Job() @@ -133,8 +138,8 @@ def test_export_dataset(): sa_session.add(j) sa_session.flush() - app.object_store.update_from_file(d1, file_name="test-data/1.txt", create=True) - app.object_store.update_from_file(d2, file_name="test-data/2.bed", create=True) + app.object_store.update_from_file(d1, file_name=t_data_path("1.txt"), create=True) + app.object_store.update_from_file(d2, file_name=t_data_path("2.bed"), create=True) imported_history = _import_export(app, h) @@ -201,8 +206,8 @@ def test_export_dataset_with_deleted_and_purged(): assert d1.deleted - app.object_store.update_from_file(d1, file_name="test-data/1.txt", create=True) - app.object_store.update_from_file(d2, file_name="test-data/2.bed", create=True) + app.object_store.update_from_file(d1, file_name=t_data_path("1.txt"), create=True) + app.object_store.update_from_file(d2, file_name=t_data_path("2.bed"), create=True) imported_history = _import_export(app, h) @@ -237,9 +242,9 @@ def test_multi_inputs(): sa_session.add(j) sa_session.flush() - app.object_store.update_from_file(d1, file_name="test-data/1.txt", create=True) - app.object_store.update_from_file(d2, file_name="test-data/2.bed", create=True) - app.object_store.update_from_file(d3, file_name="test-data/4.bed", create=True) + app.object_store.update_from_file(d1, file_name=t_data_path("1.txt"), create=True) + app.object_store.update_from_file(d2, file_name=t_data_path("2.bed"), create=True) + app.object_store.update_from_file(d3, file_name=t_data_path("4.bed"), create=True) imported_history = _import_export(app, h) @@ -444,8 +449,8 @@ def test_export_collection_with_copied_datasets_and_overlapping_hids(): sa_session.add(dataset_history) sa_session.flush() - app.object_store.update_from_file(d1, file_name="test-data/1.txt", create=True) - app.object_store.update_from_file(d2, file_name="test-data/2.bed", create=True) + app.object_store.update_from_file(d1, file_name=t_data_path("1.txt"), create=True) + app.object_store.update_from_file(d2, file_name=t_data_path("2.bed"), create=True) d1_copy = d1.copy() d2_copy = d2.copy() @@ -653,7 +658,7 @@ def _import_export(app, h, dest_export=None): def test_import_1901_default(): - app, new_history = import_archive('test-data/exports/1901_two_datasets.tgz') + app, new_history = import_archive(t_data_path('exports/1901_two_datasets.tgz')) assert new_history datasets = new_history.datasets diff --git a/test/unit/app/tools/test_metadata.py b/test/unit/app/tools/test_metadata.py index 5123c56c815..270b5f38d2f 100644 --- a/test/unit/app/tools/test_metadata.py +++ b/test/unit/app/tools/test_metadata.py @@ -7,7 +7,7 @@ from galaxy.app_unittest_utils import tools_support from galaxy.job_execution.datasets import DatasetPath from galaxy.metadata import get_metadata_compute_strategy from galaxy.objectstore import ObjectStorePopulator -from galaxy.util import safe_makedirs +from galaxy.util import safe_makedirs, galaxy_directory class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.UsesTools): @@ -42,7 +42,7 @@ class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.U self._test_simple_output() def _test_simple_output(self): - source_file_name = os.path.join(os.getcwd(), "test/functional/tools/for_workflows/cat.xml") + source_file_name = os.path.join(galaxy_directory(), "test/functional/tools/for_workflows/cat.xml") self._init_tool_for_path(source_file_name) output_dataset = self._create_output_dataset( extension="fasta", @@ -67,7 +67,7 @@ class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.U self._test_primary_dataset_output_extension() def _test_primary_dataset_output_extension(self): - source_file_name = os.path.join(os.getcwd(), "test/functional/tools/for_workflows/cat.xml") + source_file_name = os.path.join(galaxy_directory(), "test/functional/tools/for_workflows/cat.xml") self._init_tool_for_path(source_file_name) # setting extension to 'auto' here, results in the extension specified in # galaxy.json (below) being respected. @@ -100,7 +100,7 @@ class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.U self._test_primary_dataset_output_metadata_override() def _test_primary_dataset_output_metadata_override(self): - source_file_name = os.path.join(os.getcwd(), "test/functional/tools/for_workflows/cat.xml") + source_file_name = os.path.join(galaxy_directory(), "test/functional/tools/for_workflows/cat.xml") self._init_tool_for_path(source_file_name) output_dataset = self._create_output_dataset( extension="auto", @@ -124,7 +124,7 @@ class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.U def test_list_discovery_extended(self): self.app.config.metadata_strategy = "extended" - source_file_name = os.path.join(os.getcwd(), "test/functional/tools/collection_split_on_column.xml") + source_file_name = os.path.join(galaxy_directory(), "test/functional/tools/collection_split_on_column.xml") self._init_tool_for_path(source_file_name) collection = model.DatasetCollection(populated=False) collection.collection_type = "list" From 8210ec7cda1806ca413c7689bafcc7163001487c Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 12:23:31 -0400 Subject: [PATCH 09/14] And more fixes to galaxy-app package structured and such... --- lib/galaxy/util/__init__.py | 3 ++- packages/app/MANIFEST.in | 2 +- packages/app/galaxy_ext | 1 + packages/app/setup.py | 4 ++++ test/unit/app/tools/test_metadata.py | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) create mode 120000 packages/app/galaxy_ext diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index fd4d2e56f55..c1de7a1ca31 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -1527,6 +1527,7 @@ def safe_str_cmp(a, b): return rv == 0 +# Don't use these two directly, prefer method version that "works" with packaged Galaxy. galaxy_root_path = os.path.join(__path__[0], os.pardir, os.pardir, os.pardir) # type: ignore galaxy_samples_path = os.path.join(__path__[0], os.pardir, 'config', 'sample') # type: ignore @@ -1539,7 +1540,7 @@ def galaxy_directory(): def galaxy_samples_directory(): - return os.path.abspath(galaxy_samples_path) + return os.path.join(galaxy_directory(), 'lib', 'galaxy', 'config', 'sample') def config_directories_from_setting(directories_setting, galaxy_root=galaxy_root_path): diff --git a/packages/app/MANIFEST.in b/packages/app/MANIFEST.in index 35fc6a3a551..438b5168639 100644 --- a/packages/app/MANIFEST.in +++ b/packages/app/MANIFEST.in @@ -1,5 +1,5 @@ include *.rst *.txt LICENSE include galaxy/*.yml -include galaxy/config/sample/*.sample +include galaxy/config/sample/*.sample* include galaxy/jobs/runners/util/job_script/*.sh include galaxy/tools/*tsv diff --git a/packages/app/galaxy_ext b/packages/app/galaxy_ext new file mode 120000 index 00000000000..10704220642 --- /dev/null +++ b/packages/app/galaxy_ext @@ -0,0 +1 @@ +../../lib/galaxy_ext/ \ No newline at end of file diff --git a/packages/app/setup.py b/packages/app/setup.py index 52605e3b79d..4ebfc6b907f 100644 --- a/packages/app/setup.py +++ b/packages/app/setup.py @@ -93,6 +93,10 @@ PACKAGES = [ 'galaxy.workflow.reports', 'galaxy.workflow.resources', 'galaxy.workflow.schedulers', + 'galaxy_ext', + 'galaxy_ext.container_monitor', + 'galaxy_ext.expressions', + 'galaxy_ext.metadata', ] ENTRY_POINTS = ''' [console_scripts] diff --git a/test/unit/app/tools/test_metadata.py b/test/unit/app/tools/test_metadata.py index 270b5f38d2f..a3eb7b9509c 100644 --- a/test/unit/app/tools/test_metadata.py +++ b/test/unit/app/tools/test_metadata.py @@ -7,7 +7,7 @@ from galaxy.app_unittest_utils import tools_support from galaxy.job_execution.datasets import DatasetPath from galaxy.metadata import get_metadata_compute_strategy from galaxy.objectstore import ObjectStorePopulator -from galaxy.util import safe_makedirs, galaxy_directory +from galaxy.util import galaxy_directory, safe_makedirs class MetadataTestCase(unittest.TestCase, tools_support.UsesApp, tools_support.UsesTools): From 9ccd770c8290a1a5b40759169d77df758b725c73 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 13:03:10 -0400 Subject: [PATCH 10/14] CircleCI - install node for expression tests. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7e557b6896..7517819385d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,8 +17,8 @@ variables: - ~/.cache/yarn install_tox: &install_tox run: sudo pip install tox - install_ffprobe: &install_ffprobe - run: sudo apt-get update && sudo apt-get install ffmpeg -y + install_deb_reqs: &install_deb_reqs + run: sudo apt-get update && sudo apt-get install ffmpeg nodejs -y set_workdir: &set_workdir working_directory: ~/repo requires_get_code: &requires_get_code @@ -100,7 +100,7 @@ jobs: steps: - *restore_repo_cache - *install_tox - - *install_ffprobe + - *install_deb_reqs - run: tox -e test_galaxy_release test_galaxy_packages: docker: @@ -109,7 +109,7 @@ jobs: steps: - *restore_repo_cache - *install_tox - - *install_ffprobe + - *install_deb_reqs - run: tox -e test_galaxy_packages js_unit: docker: From d6a78b8343ad2a8f871dd41c31f0a0c6d678cb57 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 13:06:47 -0400 Subject: [PATCH 11/14] Move unit test code covering tool_shed into webapps package - not in Galaxy core anymore. --- test/unit/{app/tools => webapps}/test_tool_validation.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/unit/{app/tools => webapps}/test_tool_validation.py (100%) diff --git a/test/unit/app/tools/test_tool_validation.py b/test/unit/webapps/test_tool_validation.py similarity index 100% rename from test/unit/app/tools/test_tool_validation.py rename to test/unit/webapps/test_tool_validation.py From c7b5134d51b78aaf85806180284518a0f3a121b6 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 13:11:42 -0400 Subject: [PATCH 12/14] More informative error messages in job unit tests. --- test/unit/app/jobs/test_job_configuration.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/unit/app/jobs/test_job_configuration.py b/test/unit/app/jobs/test_job_configuration.py index 5a212ba9c9c..dc3e9e201be 100644 --- a/test/unit/app/jobs/test_job_configuration.py +++ b/test/unit/app/jobs/test_job_configuration.py @@ -97,7 +97,19 @@ class BaseJobConfXmlParserTestCase(unittest.TestCase): def _write_config_from(self, path, template=None): template = template or {} - contents = open(path).read() + try: + contents = open(path).read() + except FileNotFoundError: + dir_path = os.path.dirname(path) + if os.path.exists(dir_path): + contents = os.listdir(dir_path) + raise Exception(f"Failed to find file {path}, directory {dir_path} exists and contains {contents}") + else: + dir_that_exists = dir_path + while not os.path.exists(dir_that_exists): + dir_that_exists = os.path.dirname(dir_that_exists) + contents = os.listdir(dir_that_exists) + raise Exception(f"Failed to find file {path}, directory {dir_path} does not exist - {dir_that_exists} is the first root that exists and contains {contents}.") if template: contents = contents.format(**template) self._write_config(contents) From a8c87d0b7ad6d45db250af1acc8aa97f2b401d49 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 27 Sep 2021 15:50:11 -0400 Subject: [PATCH 13/14] Another missing dependency in galaxy-app. --- packages/app/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/app/requirements.txt b/packages/app/requirements.txt index e96238b51f1..f72004d2d1d 100644 --- a/packages/app/requirements.txt +++ b/packages/app/requirements.txt @@ -7,6 +7,7 @@ galaxy-web-stack celery cloudauthz==0.6.0 +cwltool==3.0.20201109103151 kombu Beaker pykwalify From 74e96d3a04f2b17324c66d4d405fed6544402a33 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 28 Sep 2021 08:47:25 -0400 Subject: [PATCH 14/14] Pin an older version of setuptools for package testing to work around use_2to3 required by rdflib. --- packages/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test.sh b/packages/test.sh index c256e568ede..70a0608a621 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -14,7 +14,7 @@ TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)} virtualenv -p "$TEST_PYTHON" "$TEST_ENV_DIR" . "${TEST_ENV_DIR}/bin/activate" -pip install --upgrade pip setuptools wheel +pip install --upgrade pip 'setuptools<58' wheel pip install -r../lib/galaxy/dependencies/pinned-lint-requirements.txt # ensure ordered by dependency dag