Commit Graph
36 Commits
Author SHA1 Message Date
Sergey Golitsynskiy 349c0502ab Add unit test for testing dataset/job relationship 2021-04-01 17:18:44 -04:00
Sergey Golitsynskiy d40dabbe12 Fix linting errors 2021-03-21 22:32:54 -04:00
Sergey Golitsynskiy fdc1852201 Replace refs to sqlalchemy-utils 2021-03-21 22:08:21 -04:00
Nicola Soranzo dfb9665304 Merge branch 'release_21.01' into dev 2021-02-17 13:33:49 +00:00
mvdbeek 79b6bdbc60 Add missing assert statement in unit test 2021-02-17 12:40:55 +01:00
Nate Coraor 7a15718861 Merge remote-tracking branch 'upstream/release_21.01' into dev 2021-02-16 21:59:52 -05:00
Nicola Soranzo 80c423b684 Fix MetadataCollection attribute access for tools
Follow-up on https://github.com/galaxyproject/galaxy/pull/11353 .
2021-02-16 22:52:59 +00:00
Nate Coraor f6c0ded494 Merge remote-tracking branch 'upstream/release_21.01' into dev 2021-02-13 13:31:05 -05:00
mvdbeek af47800c49 Add unit test 2021-02-13 16:09:10 +01:00
mvdbeek 156950f9c8 Small unittest 2021-02-12 09:24:48 +01:00
Marius van den Beek 9914f38320 Merge pull request #11267 from nsoranzo/merge_20.09
Merge 20.09 into 21.01
2021-02-01 15:07:21 +01:00
Dannon Baker 6c155bf2ef Standardize test format 2021-01-29 12:05:41 -05:00
Dannon Baker 0b84678f43 Add a couple basic tests for username/email validation 2021-01-29 12:04:51 -05:00
Nicola Soranzo d26b3d9848 Fix all E203, E741 and W504 flake8 errors 2021-01-18 10:35:41 +00:00
Nicola Soranzo 452aba9ee3 Fix remaining issues reported by bugbear; add it to flake8 reqs 2021-01-16 05:58:15 +00:00
John Chilton a7b6f08446 Type checking fixes for galaxy-data (datatypes and models). 2020-12-28 16:43:14 -05:00
John Chilton e824a9e93e Merge pull request #10862 from mvdbeek/refactor_mkstemp
Replace usage of mkstemp with NamedTemporaryFile
2020-12-18 10:07:45 -05:00
mvdbeek ccdb6c3f10 Replace usage of mkstemp with NamedTemporaryFile 2020-12-07 22:31:53 +01:00
John Chilton 7cccf3a8b5 Make import global :( 2020-12-07 15:04:38 -05:00
John Chilton d145b9729b Unit testing and optimization for creating private roles and dataset sharing.
Add an optinon to run the mapping tests on postgres as well.
2020-12-07 14:57:35 -05:00
Marius van den Beek 554e17e0ba Merge pull request #10212 from jmchilton/quota_interface
Implement quota interface - with better logic isolation and unit tests.
2020-11-18 12:36:34 +01:00
mvdbeek 7df17504bf Merge branch 'release_20.09' into dev 2020-11-05 19:03:01 +01:00
John Chilton 9985c85046 Merge pull request #10582 from mvdbeek/fix_ldda_circular_dependency
[20.09] Resolve LDDA <-> Library Dataset circular dependency
2020-11-03 10:57:27 -05:00
mvdbeek 2f5742c7c0 Merge branch 'release_20.09' into dev 2020-11-03 16:04:22 +01:00
mvdbeek 14ced3cbae Set FK on left side of one to many DCE/DC relation
I think this may fix a circular dependency between dataset_collection
and dataset_collection_element. This doesn't appear to be a problem
if dataset_collection has an id already, but the set of optimizations
that went into 20.09 may get us into the situation where that is not the
case.

I hope this fixes:
```
galaxy.job_execution.output_collect ERROR 2020-11-01 14:58:59,036 Problem gathering output collection.
Traceback (most recent call last):
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1284, in _execute_context
cursor, statement, parameters, context
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.NotNullViolation: null value in column "dataset_collection_id" violates not-null constraint
DETAIL:  Failing row contains (13330967, null, 30637828, null, null, 0, ERR4597396__single).
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/galaxy/server/lib/galaxy/job_execution/output_collect.py", line 156, in collect_dynamic_outputs
final_job_state=job_context.final_job_state,
File "/opt/galaxy/server/lib/galaxy/model/store/discover.py", line 286, in populate_collection_elements
self.flush()
File "/opt/galaxy/server/lib/galaxy/job_execution/output_collect.py", line 214, in flush
self.sa_session.flush()
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2523, in flush
self._flush(objects)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2664, in _flush
transaction.rollback(_capture_exception=True)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2624, in _flush
flush_context.execute()
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
rec.execute(self)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
uow,
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 236, in save_obj
update,
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 995, in _emit_update_statements
statement, multiparams
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1020, in execute
return meth(self, multiparams, params)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_clauseelement
distilled_params,
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1324, in _execute_context
e, statement, parameters, cursor, context
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1518, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1284, in _execute_context
cursor, statement, parameters, context
File "/opt/galaxy/venv/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column "dataset_collection_id" violates not-null constraint
DETAIL:  Failing row contains (13330967, null, 30637828, null, null, 0, ERR4597396__single).
[SQL: UPDATE dataset_collection_element SET dataset_collection_id=%(dataset_collection_id)s WHERE dataset_collection_element.id = %(dataset_collection_element_id)s]
[parameters: {'dataset_collection_id': None, 'dataset_collection_element_id': 13330967}]
(Background on this error at: http://sqlalche.me/e/gkpj)
```
2020-11-02 10:16:17 +01:00
mvdbeek c03cc3dbd4 Merge branch 'release_20.09' into dev 2020-11-01 16:59:35 +01:00
mvdbeek 6e2aad1416 Resolve LDDA <-> Library Dataset circular dependency
This eliminates a lot of excessive flushes that were needed to persist
new `LibraryDatasetDatasetAssociation` (LDDA) and `LibraryDataset` (LD) objects.  These
intermittent flushes would make LD objects visible before
they are associated with a LDDA, causing the
Exception in
https://github.com/galaxyproject/galaxy/pull/10556#issuecomment-717175641

```
galaxy.web.framework.decorators ERROR 2020-10-27 17:26:25,817 Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/lib/galaxy/web/framework/decorators.py", line 294, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "/Users/mvandenb/src/galaxy/lib/galaxy/webapps/galaxy/api/folder_contents.py", line 111, in index
    dataset = content_item.library_dataset_dataset_association.dataset
AttributeError: 'NoneType' object has no attribute 'dataset'
```

The trick here is to use `post_update=True`, so that ldda and ld rows
are INSERTED, followed by an UPDATE to create the link.
This is explained at
https://docs.sqlalchemy.org/en/13/orm/relationship_persistence.html.

This is also the groundwork for speeding up library additions by
batching flushes.
2020-10-29 11:21:53 +01:00
John Chilton 29ba2b667a Fix wf step annotations dropped after rename. 2020-10-28 14:17:28 -04:00
John Chilton 9d6c18a7a5 Unit tests for calculate_disk_usage and calculate_and_set_disk_usage. 2020-10-20 11:12:18 -04:00
John Chilton bf9a0a5d87 Improved quota test case. 2020-10-20 11:12:18 -04:00
John Chilton b75a1818dc is_over_quota test cases. 2020-10-20 11:12:18 -04:00
John Chilton c23758451a Quota test case. 2020-10-20 11:12:18 -04:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
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
2020-10-07 11:52:13 +01:00
Nicola Soranzo db904f2056 Don't allow datatype change by default if it's composite
Also re-use the HDA deserializer in the dataset controller.
2020-09-24 09:39:58 +01:00
John Chilton 6cf68bb182 Refactor lib/galaxy/objectstore/test_helpers.py to package-less objectstore_helpers.py.
Need more symlinks and such now.
2020-07-08 14:56:10 -04:00
John Chilton b7c1b03251 Refactor more unit tests into the galaxy-data package. 2020-07-07 13:44:32 -04:00