Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22.01] Backport and fix webapps tests #13478

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@
DEFAULT_LOCALE_FORMAT = '%a %b %e %H:%M:%S %Y'
ISO_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"

GALAXY_APP_NAME = 'galaxy'
GALAXY_SCHEMAS_PATH = files('galaxy.config') / 'schemas'
GALAXY_CONFIG_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / 'config_schema.yml'
UWSGI_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / 'uwsgi_schema.yml'
GALAXY_APP_NAME = "galaxy"
GALAXY_SCHEMAS_PATH = files("galaxy.config") / "schemas"
GALAXY_CONFIG_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / "config_schema.yml"
REPORTS_CONFIG_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / "reports_config_schema.yml"
TOOL_SHED_CONFIG_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / "tool_shed_config_schema.yml"
UWSGI_SCHEMA_PATH = GALAXY_SCHEMAS_PATH / "uwsgi_schema.yml"
LOGGING_CONFIG_DEFAULT: Dict[str, Any] = {
'disable_existing_loggers': False,
'version': 1,
Expand Down
10 changes: 6 additions & 4 deletions lib/galaxy/config/config_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

from galaxy.config import (
GALAXY_CONFIG_SCHEMA_PATH,
REPORTS_CONFIG_SCHEMA_PATH,
TOOL_SHED_CONFIG_SCHEMA_PATH,
UWSGI_SCHEMA_PATH,
)
from galaxy.config.schema import (
Expand Down Expand Up @@ -358,16 +360,16 @@ class OptionValue(NamedTuple):
"9009",
["tool_shed.webapp.buildapp:app_factory"],
"config/tool_shed.yml",
"lib/tool_shed/webapp/config_schema.yml",
'tool_shed.webapp.buildapp:uwsgi_app()',
str(TOOL_SHED_CONFIG_SCHEMA_PATH),
"tool_shed.webapp.buildapp:uwsgi_app()",
)
REPORTS_APP = App(
["reports_wsgi.ini", "config/reports.ini"],
"9001",
["galaxy.webapps.reports.buildapp:app_factory"],
"config/reports.yml",
"lib/galaxy/webapps/reports/config_schema.yml",
'galaxy.webapps.reports.buildapp:uwsgi_app()',
str(REPORTS_CONFIG_SCHEMA_PATH),
"galaxy.webapps.reports.buildapp:uwsgi_app()",
)
APPS = {"galaxy": GALAXY_APP, "tool_shed": SHED_APP, "reports": REPORTS_APP}

Expand Down
1 change: 0 additions & 1 deletion lib/galaxy/webapps/reports/uwsgi_schema.yml

This file was deleted.

12 changes: 3 additions & 9 deletions lib/tool_shed/webapp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@
BaseAppConfiguration,
CommonConfigurationMixin,
get_database_engine_options,
TOOL_SHED_CONFIG_SCHEMA_PATH,
)
from galaxy.config import expand_pretty_datetime_format
from galaxy.config.schema import AppSchema
from galaxy.exceptions import ConfigurationError
from galaxy.util import string_as_bool
from galaxy.version import VERSION, VERSION_MAJOR, VERSION_MINOR

try:
from importlib.resources import files # type: ignore[attr-defined]
except ImportError:
# Python < 3.9
from importlib_resources import files # type: ignore[no-redef]

log = logging.getLogger(__name__)

TOOLSHED_APP_NAME = 'tool_shed'
TOOLSHED_CONFIG_SCHEMA_PATH = files('tool_shed.webapp') / 'config_schema.yml'
TOOLSHED_APP_NAME = "tool_shed"


class ToolShedAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
Expand All @@ -36,7 +30,7 @@ class ToolShedAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
add_sample_file_to_defaults = {'datatypes_config_file'}

def _load_schema(self):
return AppSchema(TOOLSHED_CONFIG_SCHEMA_PATH, TOOLSHED_APP_NAME)
return AppSchema(TOOL_SHED_CONFIG_SCHEMA_PATH, TOOLSHED_APP_NAME)

def __init__(self, **kwargs):
super().__init__(**kwargs)
Expand Down
1 change: 0 additions & 1 deletion lib/tool_shed/webapp/uwsgi_schema.yml

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/galaxy/schema

This file was deleted.

3 changes: 2 additions & 1 deletion packages/app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Markdown
paramiko!=2.9.0,!=2.9.1
pulsar-galaxy-lib>=0.14.13
pydantic
PyJWT
pykwalify
refgenconf>=0.12.0
sqlitedict
svgwrite
tuswsgi
typing-extensions
Whoosh
119 changes: 59 additions & 60 deletions packages/app/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,66 +30,65 @@ def get_var(var_name):

TEST_DIR = 'tests'
PACKAGES = [
'galaxy',
'galaxy.actions',
'galaxy.app_unittest_utils',
'galaxy.authnz',
'galaxy.dependencies',
'galaxy.forms',
'galaxy.jobs',
'galaxy.jobs.rules',
'galaxy.jobs.runners',
'galaxy.jobs.runners.state_handlers',
'galaxy.jobs.runners.util',
'galaxy.jobs.runners.util.cli',
'galaxy.jobs.runners.util.cli.job',
'galaxy.jobs.runners.util.cli.shell',
'galaxy.jobs.runners.util.condor',
'galaxy.jobs.runners.util.job_script',
'galaxy.jobs.splitters',
'galaxy.managers',
'galaxy.schema',
'galaxy.tools',
'galaxy.tools.actions',
'galaxy.tools.data',
'galaxy.tools.data_manager',
'galaxy.tools.error_reports',
'galaxy.tools.expressions',
'galaxy.tools.filters',
'galaxy.tools.imp_exp',
'galaxy.tools.parameters',
'galaxy.tools.search',
'galaxy.tools.util',
'galaxy.tools.util.galaxyops',
'galaxy.tool_shed',
'galaxy.tool_shed.galaxy_install',
'galaxy.tool_shed.galaxy_install.datatypes',
'galaxy.tool_shed.galaxy_install.metadata',
'galaxy.tool_shed.galaxy_install.repository_dependencies',
'galaxy.tool_shed.galaxy_install.tool_dependencies',
'galaxy.tool_shed.galaxy_install.tool_dependencies.recipe',
'galaxy.tool_shed.galaxy_install.tools',
'galaxy.tool_shed.util',
'galaxy.tool_shed.metadata',
'galaxy.tool_shed.tools',
'galaxy.tours',
'galaxy.visualization',
'galaxy.visualization.data_providers',
'galaxy.visualization.data_providers.phyloviz',
'galaxy.visualization.genome',
'galaxy.visualization.plugins',
'galaxy.visualization.tracks',
'galaxy.webhooks',
'galaxy.work',
'galaxy.workflow',
'galaxy.workflow.refactor',
'galaxy.workflow.reports',
'galaxy.workflow.resources',
'galaxy.workflow.schedulers',
'galaxy_ext',
'galaxy_ext.container_monitor',
'galaxy_ext.expressions',
'galaxy_ext.metadata',
"galaxy",
"galaxy.actions",
"galaxy.app_unittest_utils",
"galaxy.authnz",
"galaxy.dependencies",
"galaxy.forms",
"galaxy.jobs",
"galaxy.jobs.rules",
"galaxy.jobs.runners",
"galaxy.jobs.runners.state_handlers",
"galaxy.jobs.runners.util",
"galaxy.jobs.runners.util.cli",
"galaxy.jobs.runners.util.cli.job",
"galaxy.jobs.runners.util.cli.shell",
"galaxy.jobs.runners.util.condor",
"galaxy.jobs.runners.util.job_script",
"galaxy.jobs.splitters",
"galaxy.managers",
"galaxy.tools",
"galaxy.tools.actions",
"galaxy.tools.data",
"galaxy.tools.data_manager",
"galaxy.tools.error_reports",
"galaxy.tools.expressions",
"galaxy.tools.filters",
"galaxy.tools.imp_exp",
"galaxy.tools.parameters",
"galaxy.tools.search",
"galaxy.tools.util",
"galaxy.tools.util.galaxyops",
"galaxy.tool_shed",
"galaxy.tool_shed.galaxy_install",
"galaxy.tool_shed.galaxy_install.datatypes",
"galaxy.tool_shed.galaxy_install.metadata",
"galaxy.tool_shed.galaxy_install.repository_dependencies",
"galaxy.tool_shed.galaxy_install.tool_dependencies",
"galaxy.tool_shed.galaxy_install.tool_dependencies.recipe",
"galaxy.tool_shed.galaxy_install.tools",
"galaxy.tool_shed.util",
"galaxy.tool_shed.metadata",
"galaxy.tool_shed.tools",
"galaxy.tours",
"galaxy.visualization",
"galaxy.visualization.data_providers",
"galaxy.visualization.data_providers.phyloviz",
"galaxy.visualization.genome",
"galaxy.visualization.plugins",
"galaxy.visualization.tracks",
"galaxy.webhooks",
"galaxy.work",
"galaxy.workflow",
"galaxy.workflow.refactor",
"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]
Expand Down
1 change: 0 additions & 1 deletion packages/app/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mock-ssh-server
pykwalify
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed while merging forward that this shouldn't have been moved to packages/app/requirements.txt, so I haven't retained this change in the merge. Probably not that important to fix in 22.01.

pytest
testfixtures
10 changes: 2 additions & 8 deletions packages/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ PACKAGE_DIRS=(
app
webapps
)
RUN_TESTS=(1 1 1 1 1 1 1 1 1 1 1 1 0)
RUN_MYPY=(1 1 1 1 1 1 1 1 1 1 1 1 1)
for ((i=0; i<${#PACKAGE_DIRS[@]}; i++)); do
printf "\n========= TESTING PACKAGE ${PACKAGE_DIRS[$i]} =========\n\n"
package_dir=${PACKAGE_DIRS[$i]}
Expand All @@ -53,11 +51,7 @@ for ((i=0; i<${#PACKAGE_DIRS[@]}; i++)); do

pip install -r test-requirements.txt

if [[ "${RUN_TESTS[$i]}" == "1" ]]; then
pytest --doctest-modules galaxy tests
fi
if [[ "${RUN_MYPY[$i]}" == "1" ]]; then
make mypy
fi
pytest --doctest-modules galaxy tests
make mypy
cd ..
done
6 changes: 3 additions & 3 deletions packages/util/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ bleach
boltons
docutils
importlib_resources
markupsafe
MarkupSafe
packaging
pycryptodome
pyyaml
PyYAML
requests
routes
Routes
typing-extensions
zipstream-new
19 changes: 19 additions & 0 deletions packages/webapps/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
a2wsgi
galaxy-app
galaxy-data
galaxy-job-execution
galaxy-tool-util
galaxy-util
galaxy-web-framework
Babel
Cheetah3
fastapi>=0.68.2,!=0.69.0,!=0.70.0,!=0.70.1
fastapi-utils
gunicorn
gxformat2
importlib_resources
Mako
MarkupSafe
Paste
pydantic
PyJWT
python-dateutil
python-multipart # required to support form parsing in FastAPI/Starlette
PyYAML
requests
Routes
SQLAlchemy>=1.4.25,<2
starlette
starlette-context
tuswsgi
typing-extensions
uvicorn
uvloop
WebOb
Whoosh
1 change: 1 addition & 0 deletions packages/webapps/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
httpx
pytest
1 change: 1 addition & 0 deletions packages/webapps/tests/webapps
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ psutil = "*"
pulsar-galaxy-lib = ">=0.14.13"
pycryptodome = "*"
pydantic = "*"
PyJWT = "*"
pykwalify = "*"
pyparsing = "*"
pysam = "*"
python = ">=3.7,<4"
python-dateutil = "*"
python-multipart = "*" # required to support form parsing in FastAPI/Starlette
pyuwsgi = "*"
PyYAML = "*"
Expand Down
2 changes: 0 additions & 2 deletions scripts/release-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ def main(old_revision, new_revision=None):
globs = (
"config/*.yml.sample",
"lib/galaxy/config/schemas/*schema.yml",
"lib/galaxy/webapps/reports/config_schema.yml",
"lib/tool_shed/webapp/config_schema.yml",
)
files_to_diff = [f for g in globs for f in glob.glob(g)]
added = {}
Expand Down
Loading