Commit Graph
270 Commits
Author SHA1 Message Date
mvdbeek ec7929c742 Construct CTEs using sqlalchemy core 2025-08-11 17:17:15 +02:00
mvdbeek c2ddea2217 Implement touch collection update time CTE 2025-08-11 17:17:10 +02:00
Nicola Soranzo 7f89e0eab9 Code cleanups from pyupgrade
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.
2025-07-31 11:17:22 +01:00
John Chilton d26605517e Implement sample sheets. 2025-07-25 11:46:59 -04:00
John Chilton cb2d5cc611 Implement nested collection test in test_model_discovery. 2025-05-14 12:57:29 -04:00
Eli Chadwick 70cd4511b0 avoid caching in python 3.9 2025-05-07 10:45:12 +01:00
Eli Chadwick f9688c43a7 isort 2025-05-07 10:45:11 +01:00
Eli Chadwick 09458577b2 linting 2025-05-07 10:45:10 +01:00
Eli Chadwick 007541d1e3 add version check to xfail 2025-05-07 10:45:10 +01:00
Eli Chadwick a4fbf706b4 fix version check 2025-05-07 10:45:09 +01:00
Eli Chadwick bd4da7a339 fix problem with non-existent files failing validation 2025-05-07 10:45:08 +01:00
Eli Chadwick d1906cbf54 work around dependency issues 2025-05-07 10:45:08 +01:00
Eli Chadwick 419930627b work around dependency issues 2025-05-07 10:45:08 +01:00
Eli Chadwick 5cf1dde60c checked tests 2025-05-07 10:45:07 +01:00
Eli Chadwick ed36c907b7 add tests using roc_validator 2025-05-07 10:45:06 +01:00
mvdbeek c03d179db0 Implement dataset collection support in workflow landing requests
and tweak request models to make them compatible with workflow test format
2025-04-22 14:18:47 +02:00
Nicola Soranzo b7591a0872 Improve type annotations of `ModelPersistenceContext` and derived classes 2025-03-20 12:46:35 +00:00
Nicola Soranzo 05b9467c35 Merge branch 'release_24.2' into dev 2025-03-13 00:37:29 +00:00
John Davis 104a375ea4 Add get_private_role_user_emails_dict, test
Retrieves a mapping of private role ids to associated users' emails.
Used to lookup a user's email when generating a displayed_name for
private roles.
2025-03-11 00:34:22 -04:00
John Davis c4c66078d8 Factor out get_displayable_roles, add test 2025-03-10 11:13:13 -04:00
John Davis f2f55131b2 Fix unit tests 2025-03-10 11:13:13 -04:00
John Davis dfe1536a5d Update test fixture
Specify correct role name for private roles. See comment in make_role
definition for why this must be set.
2025-03-10 11:13:13 -04:00
Nicola Soranzo 9477c7773e Use model classes from `galaxy.model instead of app.model` object
for proper type annotation of query results.

Also:
- Drop unused code from `lib/tool_shed/webapp/controllers/user.py`
- Drop Galaxy model code from
  `lib/tool_shed/util/admin_util.py:Admin.purge_user()`
2025-02-26 12:41:40 +00:00
Nicola Soranzo 0f1bfb6839 Type annotation improvements 2025-02-21 15:46:14 +00:00
mjosse c6267d690d imrpove ro-crate with eli's review 2025-01-30 16:14:21 +01:00
Marius van den Beek 951044096c Drop stray print statement 2025-01-30 16:14:21 +01:00
mjosse 6204702f1d rm useless import 2025-01-30 16:14:17 +01:00
mjosse 5a2c9c3fe8 rm label 2025-01-30 16:14:17 +01:00
mjosse 89920ee828 try to fix conflicts 2025-01-30 16:14:16 +01:00
mjosse 29b9fbe860 add some tests 2025-01-30 16:14:15 +01:00
mjosse 7eee144b31 remove useless tests 2025-01-30 16:13:47 +01:00
mjosse 861174e44e fix lint rm useless import 2025-01-30 16:13:46 +01:00
mjosse 81e055fa90 add some tests 2025-01-30 16:13:46 +01:00
John Davis 6f47682a39 Remove transaction helper from test.unit.data 2025-01-23 11:39:24 -05:00
Nicola Soranzo aa49793ecf Make CompressedFile a context manager
to ensure that the archive is closed.
2025-01-18 14:40:30 +00:00
Nicola Soranzo 944450aa38 Uniform use of tmp_path in ro-crate tests 2025-01-10 15:12:17 +00:00
John Davis 16f7700ea4 Move method out of managers into model
To accommodate package unit testing
2024-11-20 16:52:23 -05:00
John Davis b3e57cb9a2 Cleanup sharing roles on user purge, refactor, test
1. Update sharing role name removing purged user email
2. If sharing role has only one user association, delete it.
3. Factor out cleanup, add test.

Note: this will not work if user email has been udpated after the sharing
role was created.
2024-11-20 16:52:23 -05:00
John Davis 4be1eaf692 Update unit test w/new method name 2024-10-31 09:28:49 -04:00
John DavisandDavid López 4a7eb0a6ec Fix typo
Co-authored-by: David López <46503462+davelopez@users.noreply.github.com>
2024-10-31 09:25:48 -04:00
John Davis 16f1d3f0e3 Fix error in select, add test
We must use a union because when we retrieve roles with a query, we
check against:
1) role name
2) email of associated user for private roles

We factor out this select into a helper method, which we then test
extensively.
2024-10-30 15:28:47 -04:00
John Davis 0e51a52272 Move test fixture to conftest 2024-10-30 15:28:47 -04:00
John Davis e255a384cd Modify make_role fixture to accommodate downgrading in migration tests 2024-10-30 15:28:47 -04:00
John Davis f623ee851f Adjust unit test: role name == user's current email 2024-10-30 15:28:47 -04:00
John Chilton 7f7710d392 Implement recovering normalized workflow request from invocation. 2024-10-15 09:12:05 -04:00
John Davis 00bebee7c7 Add test exposing bug
After user's email has been modified, we can't retrieve sharing roles
for that user
2024-10-04 14:44:41 -04:00
John Chilton 813ed02d53 Merge pull request #18886 from jdavcs/dev_db_test_update
Refactor migration testing setup code
2024-09-25 10:49:27 -04:00
Matthias Bernt 7dd606a6b2 Merge branch 'release_24.1' into dev
# Conflicts:
#	lib/galaxy/version.py
#	packages/app/HISTORY.rst
#	packages/app/setup.cfg
#	packages/auth/HISTORY.rst
#	packages/auth/setup.cfg
#	packages/config/HISTORY.rst
#	packages/config/setup.cfg
#	packages/data/HISTORY.rst
#	packages/data/setup.cfg
#	packages/files/HISTORY.rst
#	packages/files/setup.cfg
#	packages/job_execution/HISTORY.rst
#	packages/job_execution/setup.cfg
#	packages/job_metrics/HISTORY.rst
#	packages/job_metrics/setup.cfg
#	packages/navigation/HISTORY.rst
#	packages/navigation/setup.cfg
#	packages/objectstore/HISTORY.rst
#	packages/objectstore/setup.cfg
#	packages/schema/HISTORY.rst
#	packages/schema/setup.cfg
#	packages/selenium/HISTORY.rst
#	packages/selenium/setup.cfg
#	packages/test_api/HISTORY.rst
#	packages/test_api/setup.cfg
#	packages/test_base/HISTORY.rst
#	packages/test_base/setup.cfg
#	packages/test_driver/HISTORY.rst
#	packages/test_driver/setup.cfg
#	packages/tool_shed/HISTORY.rst
#	packages/tool_shed/setup.cfg
#	packages/tool_util/HISTORY.rst
#	packages/tool_util/setup.cfg
#	packages/tours/HISTORY.rst
#	packages/tours/setup.cfg
#	packages/util/HISTORY.rst
#	packages/util/setup.cfg
#	packages/web_apps/HISTORY.rst
#	packages/web_apps/setup.cfg
#	packages/web_framework/HISTORY.rst
#	packages/web_framework/setup.cfg
#	packages/web_stack/HISTORY.rst
#	packages/web_stack/setup.cfg
2024-09-25 14:29:37 +02:00
John Davis b57ec18991 Refactor migration testing setup code
- Do not explicitly import fixtures (a little duplication is safer/cleaner)
- Move dangerous fixture into module to prevent accidental usage from other modules
- Ensure only one database is used for all tests in module
2024-09-24 20:47:09 -04:00
John Davis 03641a98fa Fix migration data fixes tests
When upgrading back to a valid revision, upgrade to head, not the
revision under test: we need the latest version of the model definition
in the database for the test to cleanup correctly.
2024-09-24 16:16:05 -04:00