Commit Graph
3325 Commits
Author SHA1 Message Date
Nicola Soranzo 0e7b0eb83b Extend .venv paths to ignore
Useful when creating virtual environments for several Python versions
(e.g. `.venv38`, `.venv312`), which otherwise are linted by tools like
black, isort and flake8.
2024-01-22 20:33:47 +00:00
Nicola Soranzo 12ad482d66 Fix B038 errors reported by flake8-bugbear 24.1.17 2024-01-22 20:33:47 +00:00
Nicola Soranzo 9978004f34 Fix tests after Python 3.12 changes for comprehensions 2024-01-21 20:46:09 +00:00
mvdbeek e02a765b7b Merge branch 'release_23.2' into dev 2024-01-18 12:23:00 +01:00
mvdbeek ef26fc4685 Use MockApp instead of celery_injected_app_container
Sorry, I guess the idea was to not have to build a full MockApp ?
Realisitically all tasks access the database at this point.
I suppose we could make the decorators more specific if necessary ?
2024-01-17 12:45:20 +01:00
Nicola Soranzo 81a16d3e92 Skip unit tests that require node when it's not installed 2024-01-15 18:32:05 +00:00
mvdbeek 03f01da108 Merge branch 'release_23.2' into dev 2024-01-15 12:09:43 +01:00
mvdbeek a2cb91487a Merge branch 'release_23.1' into release_23.2 2024-01-15 12:05:09 +01:00
mvdbeek 01502917f7 Fix `to_cwl` for nested collections
Fixes
```
TypeError
Object of type DatasetCollection is not JSON serializable
```
seen when running https://github.com/galaxyproject/iwc/pull/315
2024-01-12 12:24:59 +01:00
mvdbeek 04441e503c Fix encoded id unit test 2024-01-08 11:33:44 +01:00
mvdbeek a13932c71c Fix id field unit tests 2024-01-08 11:33:34 +01:00
mvdbeek 649895eb8d .dict() -> .model_dump() 2024-01-08 11:33:32 +01:00
mvdbeek 79f1c292b5 Drop more deprecated .dict() and .construct() calls 2024-01-08 11:33:31 +01:00
mvdbeek ac41a2bd44 More root and model fixes 2024-01-08 11:33:30 +01:00
mvdbeek 8a3d8058f6 Remove more __root__ and construct calls 2024-01-08 11:33:30 +01:00
mvdbeek ed1c30a8b9 Fix fetch_data schema unit tests 2024-01-08 11:33:29 +01:00
mvdbeek 1593570e33 Replace DecodedDatabaseIdField.encode with Security.security.encode_id 2024-01-08 11:33:25 +01:00
mvdbeek 7f529e63c7 Merge branch 'release_23.2' into dev 2024-01-04 16:07:26 +01:00
mvdbeek bc5259f5d2 Merge branch 'release_23.1' into release_23.2 2024-01-04 16:02:16 +01:00
Marius van den Beek d0a7562ad7 Merge pull request #17236 from mvdbeek/fix_schema_integrity
[23.1] Separate collection and non-collection data element
2024-01-02 20:41:31 +02:00
mvdbeek 68211090e6 Skip test when ftp.gnu.org not available 2024-01-01 11:21:49 +02:00
mvdbeek 242f75ceec Type fixes for starlette 0.34.0
Starlette removed some Any annotations in 0.34.0.
Issue tracked in https://github.com/abersheeran/a2wsgi/issues/44
2024-01-01 11:13:40 +02:00
mvdbeek 4027c99350 Skip test when ftp.gnu.org not available 2024-01-01 10:07:30 +02:00
mvdbeek ccdd733121 Commit and legacy backpopulate pattern from unit test 2023-12-25 10:59:05 +01:00
mvdbeek 5e7401a285 Merge branch 'release_23.2' into dev 2023-12-23 15:18:08 +01:00
mvdbeek 7105af4917 Merge branch 'release_23.1' into release_23.2 2023-12-23 15:17:49 +01:00
mvdbeek 1113f4c744 Fix User.current_galaxy_session 2023-12-23 10:34:11 +01:00
John Chilton 4bb1c4b4ce Merge pull request #17205 from jdavcs/dev_cbv
Vendorize fastapi-utls.cbv
2023-12-22 10:28:32 -05:00
Marius van den Beek 9d2a1cdcef Merge pull request #17209 from bernt-matthias/converter-reload
Reload built-in converters on toolbox reload
2023-12-19 16:07:52 +01:00
mvdbeek 038d31eb34 Merge branch 'release_23.2' into dev 2023-12-19 12:01:19 +01:00
Matthias Bernt e725f421b4 Reload built-in converters on toolbox reload
fixes #16947

also adds a setter to `MockApp` in order to fix the following
which was shown during tests

```
  /home/berntm/projects/galaxy/.venv/lib/python3.10/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-7 (check)

  Traceback (most recent call last):
    File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
      self.run()
    File "/usr/lib/python3.10/threading.py", line 953, in run
      self._target(*self._args, **self._kwargs)
    File "/home/berntm/projects/galaxy/lib/galaxy/tool_util/toolbox/watcher.py", line 153, in check
      self.reload_callback()
    File "/home/berntm/projects/galaxy/lib/galaxy/app_unittest_utils/toolbox_support.py", line 44, in <lambda>
      app.watchers.tool_config_watcher.reload_callback = lambda: reload_callback(test_case)
    File "/home/berntm/projects/galaxy/lib/galaxy/app_unittest_utils/toolbox_support.py", line 193, in reload_callback
      test_case._toolbox = test_case.app.toolbox = SimplifiedToolBox(test_case)
  AttributeError: can't set attribute 'toolbox'

    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
```
2023-12-19 11:31:06 +01:00
John Davis 7d6a0eed19 Fix import in unit test 2023-12-18 15:03:10 -05:00
John Davis c6dad0bce6 Fix linting, add attribution 2023-12-18 14:51:58 -05:00
John Davis a8a2903a31 Copy fastapi-utils.cbv.py + unit tests, change import 2023-12-18 14:16:48 -05:00
Nate Coraor c650007360 Cgroupsv2 metrics instrumenter tests 2023-12-14 13:29:19 -05:00
John Davis 377f783e20 Commit instead of flushing in unit test
Rationale:
We use an in-memory sqlite database for quota tests. With SA 2.0 (or
with the `future` flag enabled on the engine), the following conflict
happens: (this is a simplified model)

foo = Foo()
session.add(foo)
session.flush()

engine = session.get_bind()
with engine.connect() as conn:
    conn.execute(some-sql)

foo.bar = "new value"
session.commit() # BOOM!!!!  sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'galaxy_user' expected to update 1 row(s); 0 were matched.

Reason for BOOM:
With an in-memory database, the underlying dbapi_connection object is
the same for the session and the engine.connect(). Here's what happens:

line 10: foo is flushed to the db tmp buffer
line 14: conn is closed on exit from context manager, which issues a
rollback, which rolls back whatever is in the tmp buffer - so foo is
never inserted.
line 16: foo is updated
line 17: error happens: the session thinks it's updating foo's record in
the db, but that record does not exist therefore, "0 rows matched".

Solution: commit instead of flushing - then foo is inserted.
2023-12-12 14:38:46 -05:00
John Davis 475f7227c4 Add future=True flag to SA engine 2023-12-12 09:54:08 -05:00
John Davis 95fa80105a Fix "statement is being autocommitted" SA2.0 warning 2023-12-11 16:09:44 -05:00
Nicola Soranzo 2f74a8447f Merge branch 'release_23.2' into dev 2023-12-07 14:32:07 +00:00
mvdbeek 68a8608e16 Allow parsing lists of simple test assertions 2023-12-06 13:23:17 +01:00
Nicola Soranzo 8eb657bd4f Merge branch 'release_23.2' into dev 2023-12-04 17:07:23 +00:00
Nicola Soranzo 6fc2e19871 Merge pull request #17107 from jdavcs/23.2_filename_dswrapper
[23.2] Expose file_name property in DatasetFilenameWrapper
2023-12-02 14:02:24 +00:00
mvdbeek 0cc9225ca0 Add file_name property on DatasetFilenameWrapper 2023-12-01 19:57:38 +01:00
Nicola Soranzo ddbcb39fb3 Merge pull request #17058 from davelopez/remove_web_dependency_from_tools
Remove web framework dependency from tools
2023-12-01 12:29:26 +00:00
mvdbeek 1ed51108e1 Merge branch 'release_23.2' into dev 2023-12-01 11:53:04 +01:00
mvdbeek e3d18005db Merge branch 'release_23.1' into release_23.2 2023-12-01 11:52:34 +01:00
mvdbeek e502863657 Add missing optional description field, fixes ephemeris data library example 2023-12-01 11:00:52 +01:00
davelopez 4eb22fe6a4 Replace testable_url_for with mock_url_builder 2023-11-30 17:01:29 +01:00
davelopez d1ca9cf4f3 Adapt unit tests to use url_builder mock 2023-11-30 17:01:29 +01:00
davelopez c416ef41ad Move STS unit tests to test/unit/app
Temporarily until we create its own package.
2023-11-30 17:01:29 +01:00