Commit Graph
2865 Commits
Author SHA1 Message Date
Björn Grüning 6a5608bcd6 Merge pull request #15031 from jmchilton/structured_test_decorators
Infrastructure for indicating Galaxy features being used by tests.
2022-12-03 10:34:49 +01:00
davelopez efcf76e3b5 Return 404 when target expires or doesn't exists 2022-12-02 09:57:29 +01:00
John Davis 0aa0feb610 Merge pull request #15004 from jdavcs/dev_mypy_workflow
Run mypy on a fully loaded galaxy venv for stricter type checking
2022-11-30 22:30:37 -05:00
Martin Cech e4becc21a0 Merge pull request #14959 from bernt-matthias/topic/lint-expect_failure_num_outputs
lint for coexisting expect_num_outputs and expect_failure
2022-11-30 20:06:29 +01:00
John DavisandNicola Soranzo 02ea4f531e Drop unused attr
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-11-30 13:39:16 -05:00
John DavisandNicola Soranzo 67c7e7d1ac Use a simple cast instead of relying on dependency injection
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-11-30 13:33:42 -05:00
Nicola Soranzo 139d14e952 Fix `object_store type in MinimalToolApp` protocol 2022-11-30 17:55:04 +00:00
Nicola Soranzo 95ccefacb8 Improve type annotations for model store
and related files.

Follow-up on https://github.com/galaxyproject/galaxy/pull/14971 .
2022-11-30 01:45:56 +00:00
John Davis 71769182b6 Ignore 2 type errors in tests 2022-11-29 14:59:17 -05:00
John Davis cbabba8f49 Fix typing error in unit test 2022-11-29 14:59:17 -05:00
John Davis aba2b4c52a Fix mypy error (has-type)
Fixes this error: (the value is of type sqlalchemy.orm.Session; I don't
know what it's not inferred)

test/unit/app/authnz/test_custos_authnz.py:225: error: Cannot determine type of "sa_session"  [has-type]
                    self.session = self.sa_session
2022-11-29 14:59:17 -05:00
Martin Cech 85058e4331 Merge pull request #15018 from natefoo/job-conf-yaml
Replace XML job conf sample with YAML
2022-11-29 00:52:05 +01:00
Matthias Bernt 0b4d75419e lint for coexisting expect_num_outputs and expect_failure
which makes no sense since output assumption are not checked
if an error occurs
2022-11-28 14:07:53 +01:00
Nicola Soranzo de5e9c0e71 Add some type annotations to `WebApplication and GalaxyWebTransaction` 2022-11-28 04:50:03 +00:00
Nicola Soranzo c5868cc717 Add overloads to `listify()` type annotations
Also:
- Add unit tests.
2022-11-28 04:50:03 +00:00
Nicola Soranzo 807fdfa5af Type annotation fixes 2022-11-28 04:50:01 +00:00
Michael R. Crusoe 2e69f64496 mypy 0.991 + bonus extra typing 2022-11-28 04:50:00 +00:00
John Chilton 018d066e36 Useful test decorators and runtime support for annotating how tests will be used. 2022-11-26 11:28:36 -05:00
John Davis d11eab88aa Merge pull request #15010 from jdavcs/dev_galaxy_root_func
Use galaxy_directory() util function to check if code is running from root or from packages
2022-11-22 10:25:38 -05:00
John Davis e0145fad50 Rename template.py >> templates.py 2022-11-21 18:12:04 -05:00
John Davis 3b488017b1 Normalize path before checking basename 2022-11-21 18:12:04 -05:00
John Davis b2d6b8d40d Skip dbscript tests if running from packages; refactor util function 2022-11-21 18:12:04 -05:00
John Davis 116682a59f Do not call split on cmd: there may be spaces in path 2022-11-21 18:12:04 -05:00
John Davis b934b27ea0 Move custom tempates unit test into app; rm jinja2 package dep from config 2022-11-21 18:12:04 -05:00
John Davis 29053fa9e4 Move test_dbscript into app
JUSTIFICATION:
As per @jmchilton:
The package tests should pretend they don't have galaxy_directory()
available because they're meant to be installed into a Python env.
This test is fundamentally not testing anything about the Galaxy data
package - it is testing scripts placed in Galaxy root directory and that
would not be available in an installed Galaxy environment.
2022-11-21 18:12:04 -05:00
John Davis 4e5a94a2b2 Use resource_path for test_dbscript 2022-11-21 18:12:04 -05:00
John Davis faf8efafd0 Use resource_path for test_migrations 2022-11-21 18:12:04 -05:00
John Davis 86cc0f2b69 Move custom templates into the config package 2022-11-21 18:12:04 -05:00
John Davis dd267e2d3e Refactor test, use galaxy_directory() 2022-11-21 18:12:04 -05:00
John Davis 821b60f30a Use galaxy_directory() instead of hacking the path 2022-11-21 18:12:04 -05:00
John Davis 44e7c97b6d Fix get_chunk(), add test 2022-11-18 18:24:54 -05:00
Nate Coraor 1cdb7b5bcd Replace XML job conf sample with YAML.
Prefer loading job_conf.yml, fall back to job_conf.xml with a warning if
it exists.
2022-11-17 19:58:24 -05:00
Nicola Soranzo 2b362fbd1d Merge branch 'release_22.05' into dev 2022-11-17 22:50:45 +00:00
Nicola Soranzo 988f4e583c Merge branch 'release_22.01' into release_22.05 2022-11-17 22:48:35 +00:00
Nicola Soranzo c80577e0b3 Fix setting `LC_CTYPE` variable in clean environment on macOS
Fix some older tools (not using `profile` or `stdio`) failing because
of the following warning printed on stderr when run locally on macOS:

```
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "C.UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
```
2022-11-17 10:50:07 +00:00
mvdbeek 7254dc9fef Also support byte-range in legacy send_file method 2022-11-16 18:33:46 +01:00
mvdbeek 304b12c143 Move things around 2022-11-16 17:01:28 +01:00
mvdbeek 69673a354b Skip test if httpbin down 2022-11-16 15:24:40 +01:00
mvdbeek 7f0754eef7 Upgrade FastAPI to 0.87.0, drop old workarounds 2022-11-16 14:31:49 +01:00
John Davis b11c18eb21 Merge pull request #14825 from neoformit/dev-html-email
Looks great! Thanks, @neoformit 

For future ref/todo: we do need a more systematic/unified approach to handling path construction that handles tests that are arun both as standalone unit tests and as part of package tests (as per observation by @neoformit)
2022-11-10 11:30:42 -05:00
Cameron Hyde c00d6d1de0 Fix linting 2022-11-10 19:10:20 +11:00
Nicola Soranzo 6c8a4305a2 Fix pytest warning
Fix:

```
PytestReturnNotNoneWarning: Expected None, but packages/tool_util/tests/tool_util/test_verify.py::test_file_list
returned [TestFile(value=b'A\nB\nC', path='/tmp/tmpi72pz4ur.txt'), TestFile(value=...],
which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
```
2022-11-08 20:23:57 +00:00
Nicola Soranzo 75169e85a1 Fix all B027 errors reported by new flake8-bugbear 2022-11-08 20:23:56 +00:00
Marius van den Beek e3a91ab217 Merge pull request #14863 from jmchilton/puslar_extended_metadata_fixes
Various Pulsar extended metadata fixes
2022-11-08 11:51:59 +01:00
John Chilton 25eb7ea906 Merge pull request #14873 from mvdbeek/enable_restriceted_value_guessing_for_subworkflow_inputs
Fix restricted values for parameter connected to subworkflow input
2022-11-07 17:38:04 +01:00
Nicola Soranzo ddf04c0dd0 Fix conda-build version not compatible
with the new miniconda Python version introduced in commit
06832df48f .

Also:
- Add unit test.
- Use `tmp_path` pytest fixture.
- Test code refactoring.
2022-11-04 00:38:23 +00:00
Nicola Soranzo 94427e5dea Fix the `singularity_container_test()` function
Fix ``test_singularity_container_test`` unit test, which failed with:

```
test/unit/tool_util/mulled/test_mulled_update_singularity_containers.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/galaxy/tool_util/deps/mulled/mulled_update_singularity_containers.py:62: in singularity_container_test
    check_output(exec_command.extend(["bash", "-c", test_command]), stderr=subprocess.STDOUT)
/usr/lib/python3.8/subprocess.py:415: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
/usr/lib/python3.8/subprocess.py:493: in run
    with Popen(*popenargs, **kwargs) as process:
/usr/lib/python3.8/subprocess.py:858: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

>           args = list(args)
E           TypeError: 'NoneType' object is not iterable

/usr/lib/python3.8/subprocess.py:1569: TypeError
```

Broken in commit 1dc1e5f219 .

Also:
- Use `tmp_path` pytest fixture.
- Add type annotations.
- Code refactorings.
- Install singularity in the mulled GitHub workflow so that the 2 singularity
  unit tests are not skipped any more.
2022-11-04 00:00:16 +00:00
Nicola Soranzo afa7b713bc Replace `GALAXY_TEST_INCLUDE_SLOW env variable with external_dependency_management` pytest marker
Fix mulled tests missing tests in `test/unit/tool_util/test_conda_resolution.py` .

Also:
- Add `coverage` tox factor to generate coverage report.
2022-11-03 21:43:37 +00:00
Nicola Soranzo 9863d20ac0 Skip S3 unit tests conditionally on s3fs module presence 2022-11-03 18:50:10 +00:00
Nicola Soranzo 10802d35a9 Mark non-slow unit tests with more relevant `@skip_if_github_down` decorator 2022-11-03 18:47:31 +00:00