From 9c45983bccd6cb92b68dd3fd51a1c684267727ba Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 3 Mar 2026 16:06:01 -0500 Subject: [PATCH 1/4] Less chatty version of pydantic-tes. --- lib/galaxy/dependencies/pinned-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index 9965560db71..654edee7347 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -206,7 +206,7 @@ pydantic-core==2.41.5 pydantic-evals==1.63.0 pydantic-graph==1.63.0 pydantic-settings==2.13.1 -pydantic-tes==0.2.0 +pydantic-tes==0.3.0 pydicom==3.0.1 pydot==4.0.1 pyeventsystem==0.1.0 From 744747301ac5c0069e4ce675e2d10e13abd30b08 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 3 Mar 2026 15:47:25 -0500 Subject: [PATCH 2/4] Fix Pydantic deprecation warnings for model_validator and core schema Convert @model_validator(mode="after") classmethods to instance methods (PydanticDeprecatedSince212). Replace super().__get_pydantic_core_schema__ with handler(source) (PydanticDeprecatedSince211). Co-Authored-By: Claude Opus 4.6 --- lib/galaxy/schema/generics.py | 4 ++-- lib/galaxy/schema/schema.py | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/galaxy/schema/generics.py b/lib/galaxy/schema/generics.py index eac8874bd0e..62e69ab5a40 100644 --- a/lib/galaxy/schema/generics.py +++ b/lib/galaxy/schema/generics.py @@ -26,8 +26,8 @@ class GenericModel(BaseModel): return f"{class_name}{suffix}" @classmethod - def __get_pydantic_core_schema__(cls, *args, **kwargs): - result = super().__get_pydantic_core_schema__(*args, **kwargs) + def __get_pydantic_core_schema__(cls, source, handler): + result = handler(source) ref_to_name[result["ref"]] = cls.__name__ return result diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 24cbf0e4d92..2dbab68380a 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -1987,27 +1987,25 @@ class ExportObjectResultMetadata(Model): error: Optional[str] = None @model_validator(mode="after") - @classmethod - def validate_success(cls, model): + def validate_success(self): """ Ensure successful exports do not have error text. """ - if model.success and model.error is not None: + if self.success and self.error is not None: raise ValueError("successful exports cannot have error text") - return model + return self @model_validator(mode="after") - @classmethod - def validate_uri(cls, model): + def validate_uri(self): """ Ensure unsuccessful exports do not have a URI. """ - if not model.success and model.uri: + if not self.success and self.uri: raise ValueError("unsuccessful exports cannot have a URI") - return model + return self class ExportObjectMetadata(Model): From 706e36b5e1f07b542fd1e18f05e534899c6db391 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 3 Mar 2026 22:42:12 -0500 Subject: [PATCH 3/4] Implement GALAXY_TEST_LOG_LEVEL. --- lib/galaxy/config/__init__.py | 12 +++++++++--- lib/galaxy_test/driver/driver_util.py | 7 ++++--- run_tests.sh | 4 +++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index 4b1d46c6df0..ad0278c75c6 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -5,6 +5,7 @@ Universe configuration builder. # absolute_import needed for tool_shed package. import configparser +import copy import json import locale import logging @@ -162,6 +163,13 @@ DEFAULT_EMAIL_FROM_LOCAL_PART = "galaxy-no-reply" DISABLED_FLAG = "disabled" # Used to mark a config option as disabled +def default_log_config(log_level: str = "DEBUG") -> dict[str, Any]: + logging_conf = copy.deepcopy(LOGGING_CONFIG_DEFAULT) + if log_level != "DEBUG": + logging_conf["handlers"]["console"]["level"] = log_level + return logging_conf + + def configure_logging(config, facts=None): """Allow some basic logging configuration to be read from ini file. @@ -186,9 +194,7 @@ def configure_logging(config, facts=None): logging_conf = config.get("logging", None) if logging_conf is None: # if using the default logging config, honor the log_level setting - logging_conf = LOGGING_CONFIG_DEFAULT - if config.get("log_level", "DEBUG") != "DEBUG": - logging_conf["handlers"]["console"]["level"] = config.get("log_level", "DEBUG") + logging_conf = default_log_config(config.get("log_level", "DEBUG")) # configure logging with logging dict in config, template *FileHandler handler filenames with the `filename_template` option for name, conf in logging_conf.get("handlers", {}).items(): if ( diff --git a/lib/galaxy_test/driver/driver_util.py b/lib/galaxy_test/driver/driver_util.py index 5e368bf0e1a..37907b887de 100644 --- a/lib/galaxy_test/driver/driver_util.py +++ b/lib/galaxy_test/driver/driver_util.py @@ -21,7 +21,7 @@ from typing import ( from urllib.parse import urlparse from galaxy.app import UniverseApplication as GalaxyUniverseApplication -from galaxy.config import LOGGING_CONFIG_DEFAULT +from galaxy.config import default_log_config from galaxy.model import mapping from galaxy.model.database_utils import ( create_database, @@ -192,7 +192,8 @@ def setup_galaxy_config( data_manager_config_file = _resolve_relative_config_paths(data_manager_config_file) tool_config_file = _resolve_relative_config_paths(tool_conf) tool_data_table_config_path = _resolve_relative_config_paths(tool_data_table_config_path) - + log_level = os.environ.get("GALAXY_TEST_LOG_LEVEL", "DEBUG").upper() + logging = default_log_config(log_level) config = dict( admin_users="test@bx.psu.edu", allow_library_path_paste=True, @@ -232,7 +233,7 @@ def setup_galaxy_config( use_heartbeat=False, user_library_import_dir=user_library_import_dir, webhooks_dir=TEST_WEBHOOKS_DIR, - logging=LOGGING_CONFIG_DEFAULT, + logging=logging, monitor_thread_join_timeout=5, object_store_store_by="uuid", fetch_url_allowlist=["127.0.0.0/24"], diff --git a/run_tests.sh b/run_tests.sh index adeab51b49b..8a88e8a78e9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -293,7 +293,9 @@ TOOL_SHED_TEST_TMP_DIR Defaults to random /tmp directory - place for tool shed test server files to be placed. TOOL_SHED_TEST_OMIT_GALAXY Do not launch a Galaxy server for tool shed testing. -GALAXY_TEST_DISABLE_ACCESS_LOG Do not log access messages +GALAXY_TEST_DISABLE_ACCESS_LOG Do not log access messages. +GALAXY_TEST_LOG_LEVEL Set Galaxy server log level for tests + (default: DEBUG). E.g. WARNING to reduce output. GALAXY_TEST_AXE_SCRIPT_URL URL of aXe script to use for accessibility testing. GALAXY_TEST_SKIP_AXE Set this to '1' to skip aXe accessibilty testing when running selenium tests. From 05ab578c66c256d0e6acbaf59c8e4e9d1c0231bb Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 3 Mar 2026 22:42:46 -0500 Subject: [PATCH 4/4] Small logging tweaks to reduce test output. --- lib/galaxy/config/__init__.py | 4 ++-- pytest.ini | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index ad0278c75c6..10dccc0cab3 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -118,9 +118,9 @@ LOGGING_CONFIG_DEFAULT: dict[str, Any] = { "level": "ERROR", "qualname": "py.warnings", }, - "celery.utils.functional": { + "celery": { "level": "INFO", - "qualname": "celery.utils.functional", + "qualname": "celery", }, "sentry_sdk.errors": { "level": "INFO", diff --git a/pytest.ini b/pytest.ini index 706dc325bb0..a1924b2c454 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,6 +2,10 @@ addopts = --doctest-continue-on-failure --verbosity=1 --showlocals asyncio_mode = auto log_level = DEBUG +filterwarnings = + ignore::DeprecationWarning:pkg_resources + ignore::DeprecationWarning:refgenconf + ignore::UserWarning:refgenconf # Install pytest-memray and set memray to true here to enable memory profiling of tests # memray = true pythonpath = lib