TestKubernetesNativeInteractiveToolsIntegration copied TestKubernetesIntegration's
volume/claim setup and tearDownClass verbatim, differing only in three name strings.
Extract KubernetesVolumesMixin so the next Kubernetes test class inherits it instead
of copying it a third time.
The mixin's claim_prefix also replaces job_config()'s jobs_directory_claim and
tool_directory_claim parameters - one name for the pair, and the job config can no
longer name claims the class did not create. Generated job_conf XML is unchanged for
both prefixes.
Also reuse what test_kubernetes_runner.py already exports:
- ingress_for_tool() moves there beside the other cluster helpers, and both it and
the two "kubectl get job -o json" call sites go through a new kubectl_get().
- The interactive tools case uses KubernetesDatasetPopulator, which dumps
"kubectl describe nodes" when a history wait fails.
``TestKubeInteractiveToolsRemoteProxyIntegration`` runs interactive tools
on Kubernetes through Pulsar, so it never exercises
``KubernetesJobRunner``. It is also skipped in CI - it needs an
externally started gx-it-proxy to fetch the tool's content over HTTP.
Between the two, nothing was checking the runner's own interactive tool
support, which is how #23203 shipped broken.
The runner configures the entry points and creates the service and
ingress while submitting the job, before any proxy is involved, so
asserting on the entry point and on the ingress it created needs no
proxy and runs wherever a cluster is available.
Split the shared helpers out of
``AbstractTestCases.BaseInteractiveToolsIntegrationTestCase`` into
``BaseInteractiveToolsTestCase`` so a test case can reuse them without
inheriting the two tests that require a proxy. Existing cases keep
inheriting both. ``job_config()`` grows claim name arguments, defaulting
to today's values, so the new case gets its own volume claims instead of
racing ``TestKubernetesIntegration`` for them across test shards.
Drop Python 3.8 support in 5 Pulsar-compatible packages
(job_metrics, tool_util, tool_util_models, util, objectstore)
and run pyupgrade --py310-plus on their source code.
- Bump requires-python from >=3.8 to >=3.10 in all 5 packages
- Remove Python 3.8 and 3.9 classifiers
- Remove ruff per-file-ignores for UP rules on these paths
- Remove backports.zoneinfo conditional dependency
- Remove pydyf<0.11 pin from conditional-requirements.txt
- Update Makefile pyupgrade target (remove PY38_PYUPGRADE_PATHS)
- Update CI workflow to test with Python 3.10 instead of 3.8
Clean up unused deprecated typing imports after pyupgrade
Remove now-unused typing imports (Dict, List, Optional, Set, Tuple,
Type, Union) that became dead after pyupgrade --py310-plus converted
annotations to use built-in types and | syntax.
Also run ruff check --fix --select=UP007,UP045 across the entire
codebase to convert remaining Optional[X] -> X | None and
Union[X, Y] -> X | Y patterns.
Enable ruff UP007/UP045 for Python 3.10 union syntax
Remove UP007 (Union[X,Y] -> X | Y) and UP045 (Optional[X] -> X | None)
from the ruff ignore list and convert all type aliases across the
codebase. These rules were deferred while Python 3.9 was supported;
requires-python is now >=3.10.
A custom script was used because neither ruff --fix nor
pyupgrade --py310-plus converts Optional[X]/Union[X,Y] in type alias
positions (e.g. X = Union[A, B]) — they only handle annotation
positions (e.g. def f(x: Optional[int])). All 167 violations were
module-level type aliases. A few edge cases were fixed manually:
single-element Union[X,], typing.Union qualified refs, runtime
Optional[type] calls, and Annotated[Optional[...]] pydantic fields.
Fix UP007 autofix regression with string forward reference type aliases
Commit fa6bd955a0 enabled ruff UP007/UP045 and auto-fixed
module-level type aliases using Union with string forward
references, producing invalid 'str | str' expressions.
This was a known ruff bug (charliermarsh/ruff#826) that has since
been fixed in later ruff versions, but this codebase was
converted before the fix was in place.
Revert to Union syntax and restore TYPE_CHECKING imports that
ruff's TCH rule cleaned up as a side effect when it thought the
forward references were unused.
Found by running:
```
make pyupgrade
ruff check --fix .
ruff check --preview --unsafe-fixes --select=F401 --fix .
make format
make update-client-api-schema
```
The bulk of the changes are replacements of typing deprecated aliases
such as `Dict` and `List` with the standard library classes. These
aliases became redundant in Python 3.9 when the corresponding
pre-existing classes were enhanced to support `[]`, see
https://docs.python.org/3/library/typing.html#deprecated-aliases
Also:
- Update the `pyupgrade` Makefile target to use `--py38-plus` for the
packages needed by Pulsar, including the new galaxy-tool-util-models
package.
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.
Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
so that the former always returns a `Response` object while the latter
returns the response content.
Also:
- In `CwlPopulator.run_cwl_job()` wait for the run only if `assert_ok`
is True; if the `wait()` call fails, summarize history also for
workflow runs.
That should make it significantly easier to debug issues when the
container monitor dies unexpectedly (which I sort of expect in the
future given that we parse output from the docker CLI).
Upgrade syntax using `pyupgrade --py36-plus` .
Manually drop several `six` imports.
Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
Instructions for setting up external goodies documented in docstring.
Small tweaks included:
- Allow serving proxies on ports different than Galaxy (so it can target external proxies without nginx/uwsgi).
- Fix up config options a bit.
Tested with Pulsar but not sure there is anything Pulsar specific about the implementation - simply set container_monitor_result on the job destination to 'callback' (instead of implicit default of 'file'). This causes the monitor.py script to hit a new job_ports API (that mirrors job_files API) and uses the same security mechanism (per-job keys that are only active while the job is active).
PR contains fixes for embedded Pulsar configuration handling, embedded Pulsar under uwsgi, and the introduction of new feature that allows dynamic expansion of ``$UWSGI_PORT`` inside of galaxy_infrastructure_url.
- enables docker destination for interactivetool tests
- fixes a wrong argument in entrypoint management
- fixes the test setup that targeted a previous iteration (which was
still called realtimetools)
- prevents deleting the working directory before python has a chance to
start the container monitor (that's the sleep command)
- fixes some odd interactive tool test assertions
- uses unicode arguments in key_type_token_mapping.py.
uwsgi arguments are always passed as bytestrings.
Split test/base into lib/galaxy_test/base and lib/galaxy_test/driver. Dividing things on whether they import galaxy-app code or not - with the goal of a galaxy-test-base package that doesn't depend on galaxy-app and a galaxy-test-driver package that does.
I've been refactoring around this division for a long time. Certain tests (namely the integration tests) always need to bootstrap Galaxy - but the API tests and the Selenium tests should be installable and runnable without Galaxy in the Python environment. So future galaxy-test-api and galaxy-test-selenium packages should have only an optional dependency on galaxy-test-driver.
Properly sturcturing these namespaces is a precursor for real packages on PyPI, clean separation of the tool shed testing code, and cleans up all the flake8 noqa hacks in test/.