Commit Graph
116 Commits
Author SHA1 Message Date
mvdbeek 973f6679d6 Merge branch 'release_21.09' into release_22.01 2022-02-11 13:29:04 +01:00
Nicola Soranzo 00b0846e8f Merge branch 'release_21.05' into release_21.09 2022-02-08 13:29:08 +00:00
mvdbeek 83c0683e86 Restore Metadata size limit
Broke in https://github.com/galaxyproject/galaxy/pull/11902
2022-02-07 15:02:02 +01:00
mvdbeek 370d343670 Limit required element validation to safe elements
There used to be a long-standing bug in setting up the MetadataValidator
if default values were used. We fixed this in
https://github.com/galaxyproject/galaxy/pull/13139/commits/e194ef97e49c4947711ad1d20873ddc0aa686a66,
but that means we're now checking for all non-optional values before
running a tool. We have a ton of non-optional MetadatElement items
in datatypes that should maybe be optional (an indication might be if
`default` and `no_value` are specified and set to the same value ... but
I'm not sure that's a 100% thing). So I think that reviewing this
requires domain knowledge of the datatypes and what elements are really required,
and I'm not sure we can do this in a timely fashion, and not break
something that used to work.

So my suggestion is that we add `check_required_metadata=True`
on datatypes for which we have checked that non-optional metadata
elements are really non-optional. For those metadata elements
for which this is not the case we skip the validation as we would
do prior to
https://github.com/galaxyproject/galaxy/pull/13139/commits/e194ef97e49c4947711ad1d20873ddc0aa686a66.

As an example I have marked  RDS and RData with check_required_metadata
and added a test for check_required_metadata.
2022-02-03 12:58:38 +01:00
Sergey Golitsynskiy b613c74384 Fix RemoveIn20Warning: use test() to wrap raw sql 2022-01-12 16:32:02 -05:00
Sergey Golitsynskiy ec455b08a8 Fix RemoveIn20 warning: use engine.begin for explicit transaction 2022-01-12 16:12:16 -05:00
mvdbeek 85d19caa16 Fix tell error
Fixes https://github.com/galaxyproject/galaxy/issues/13090:
```
Sun, Dec 19 2021 9:01:49 pm | Traceback (most recent call last):
Sun, Dec 19 2021 9:01:49 pm | File "/galaxy/server/lib/galaxy/model/store/discover.py", line 203, in set_datasets_metadata
Sun, Dec 19 2021 9:01:49 pm | primary_data.set_meta()
Sun, Dec 19 2021 9:01:49 pm | File "/galaxy/server/lib/galaxy/model/__init__.py", line 3736, in set_meta
Sun, Dec 19 2021 9:01:49 pm | return self.datatype.set_meta(self, **kwd)
Sun, Dec 19 2021 9:01:49 pm | File "/galaxy/server/lib/galaxy/datatypes/interval.py", line 412, in set_meta
Sun, Dec 19 2021 9:01:49 pm | Tabular.set_meta(self, dataset, overwrite=overwrite, skip=i)
Sun, Dec 19 2021 9:01:49 pm | File "/galaxy/server/lib/galaxy/datatypes/tabular.py", line 404, in set_meta
Sun, Dec 19 2021 9:01:49 pm | if dataset_fh.tell() != dataset.get_size():
Sun, Dec 19 2021 9:01:49 pm | OSError: telling position disabled by next() call
```

Include a unit test that hits this error.
2022-01-09 18:57:10 +01:00
Nuwan Goonasekera 01ca66fa98 Merge branch 'dev' into vault_impl 2021-12-22 23:55:37 +05:30
Nuwan Goonasekera 85b6f6353b Fix vault table parent reference 2021-12-01 21:44:29 +05:30
mvdbeek 26764218e4 Cleanup path handling and add unit test for handling traceback.txt 2021-11-30 16:18:33 +01:00
Nuwan Goonasekera d04b56bb32 Added vault model mapping test and some minor refactoring 2021-11-28 12:11:05 +05:30
Michael R. Crusoe 7819fdc7a6 tighten type ignores 2021-11-23 13:12:07 +01:00
Sergey Golitsynskiy 9f6a2cca40 Do not override History._next_id 2021-11-19 11:19:29 -05:00
Sergey Golitsynskiy cb757ed66d Add unit test for db_next_hid 2021-11-19 02:02:37 -05:00
Sergey Golitsynskiy 4ea118584d Expire hid_counter on db_next_hid() call 2021-11-18 21:37:49 -05:00
John Chilton 4fe7109ab1 Track transformations applied during uploads. 2021-11-12 10:21:55 -05:00
John Chilton 88650448e9 Fix when setting sep2tabs but not to_posix_lines.
Previously sep2tabs would imply to_posix_lines even if that was explicitly set to false. I think this new behavior is what I intended and is more correct.
2021-11-12 10:21:55 -05:00
John Chilton 8643daf1dd Attempt to type more upload related things. 2021-11-05 11:58:53 -04:00
mvdbeek b244c5ec93 Merge branch 'release_21.09' into dev 2021-10-29 16:57:13 +02:00
Sergey Golitsynskiy f497654ef0 Drop unused fixtures 2021-10-22 00:45:32 -04:00
Sergey Golitsynskiy 3418bc7b94 Ignore mypy. Rebinding a reference to a value with a diff type is OK. 2021-10-21 23:40:39 -04:00
Sergey Golitsynskiy 57997a9230 Add comment to session fixture 2021-10-21 22:55:51 -04:00
Sergey Golitsynskiy 649ed292f1 Factor out BaseTest into common 2021-10-21 22:43:56 -04:00
Sergey Golitsynskiy b0c291cd6d Do not use Galaxy's session and engine for tests (see note)
Here we are supposed to be testing mapping; however, by using Galaxy's
session and engine, we also end up testing session and engine setup
(i.e., "testing by coincidence"). Instead, we will use a plain engine
and session, thus limiting these tests to their expected scope.

Applied to model and install_model mapping tests.
2021-10-21 22:31:06 -04:00
Sergey Golitsynskiy 13286b1206 Apply changes from #12714 to model mapping tests
Disable test verification fixture by default (too expensive!)
Add comment explaining fixture + how to enable it.
2021-10-21 20:45:26 -04:00
Sergey Golitsynskiy c005eca8b1 Rename test_test_mapping; fix import 2021-10-21 19:44:18 -04:00
Sergey Golitsynskiy f622016e75 Drop duplicate stuff, reference common.py from install model test 2021-10-21 19:41:19 -04:00
Sergey Golitsynskiy afbab2f377 Move test utils out of model test into common.py 2021-10-21 19:38:53 -04:00
Sergey Golitsynskiy 837b1aa1c7 Try out black w/default settings. Because 7K lines is too much. 2021-10-21 19:29:33 -04:00
Sergey Golitsynskiy 43906e014c Use pkey comparison to compare mapped object collections (see note)
It is possible (even likely, with a different/better/simpler session
setup) that the objects populating the collection attribute representing
a relationship on a stored object will NOT be the same Python objects
that were initially associated with the object via that relationship.

Thus, Python object identity comparison will fail (when we change the
session setup). Besides, we should be using the database primary key as
the comparison key, because that is the only correct measure of
database-mapped object equality.
2021-10-21 19:28:17 -04:00
Sergey Golitsynskiy e66454734a Move mapping tests into own dir; start refactoring 2021-10-21 18:50:25 -04:00
Sergey Golitsynskiy a834b54039 Replace old function w/improved version; adjust calls 2021-10-21 18:42:23 -04:00
Sergey Golitsynskiy 518cc517fc Add better function+test for testing collection equality 2021-10-21 18:37:53 -04:00
Marius van den Beek f302a2def7 Merge pull request #12756 from ic4f/dev_install_model_declarative
Convert install_model to declarative mapping
2021-10-21 10:26:26 +02:00
Sergey Golitsynskiy d870278f7c Map ToolShedRepository declaratively (see note)
Rename metadata to metadata_. This will break things.
(we are only renaming the model attribute, not the table column)
Next step: rename all instances of [ToolShedRepository].metadata in code base.
2021-10-20 17:15:38 -04:00
Sergey Golitsynskiy 638f9a7a1c Fix import error 2021-10-20 15:12:20 -04:00
Sergey Golitsynskiy 3738c1a281 Add missing delete-from-db statement 2021-10-20 15:09:23 -04:00
Sergey Golitsynskiy 191464f2fc Map ToolVersionAssociation declaratively 2021-10-20 13:31:10 -04:00
Sergey Golitsynskiy 1fe5e6dfc8 Map ToolVersion declaratively 2021-10-20 13:22:13 -04:00
Sergey Golitsynskiy 92b32bab81 Map ToolDependency declaratively 2021-10-20 13:17:02 -04:00
Sergey Golitsynskiy a3d7a37c8e Map RepositoryDependency declaratively 2021-10-20 13:09:47 -04:00
Sergey Golitsynskiy 86a30bc0ff Map RepositoryRepositoryDependencyAssociation declaratively
Also, setup Base class for declarative
2021-10-20 13:06:49 -04:00
Sergey Golitsynskiy 29e1885975 Add nonstandard test for ToolVersion relationships 2021-10-20 12:25:07 -04:00
mvdbeek 0e11349685 Merge branch 'release_21.09' into dev 2021-10-20 17:24:41 +02:00
Sergey Golitsynskiy fb7f71a396 Add unit tests for install_model mapping 2021-10-19 21:45:14 -04:00
Sergey Golitsynskiy e2c740337d Rename mapping test, add install_model_mapping test 2021-10-19 17:30:39 -04:00
John Chilton c791fea0cf Formalize dependency of galaxy-data on galaxy.files package.
- Create a new project galaxy-files that does not depend on anything but galaxy-util.
- Add a dependency in galaxy-data on galaxy-files, use typing in galaxy.data.sniff to make this clear.
- Cleanup the galaxy-files unit tests to not depend on galaxy.datatypes.sniff code - this wasn't ideal to start with.
- Add a small integration-ish unit test test_sniff_file_sources.py to test that piece of sniff.py that depends on galaxy-files.
2021-10-11 13:16:30 -04:00
John Chilton 7006e2a7e5 More unit test fixes. 2021-10-08 11:04:00 -04:00
John Chilton 8f9034a414 Typing fixes for various unit tests. 2021-10-05 13:22:41 -04:00
John Chilton 84785b7a1d Package test-data needed for test_model_store to run as packaged. 2021-09-24 12:16:55 -04:00