diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index eb72fd8..7091237 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -81,7 +81,7 @@ jobs: run: pip install tox - name: Run tox - run: tox -e py${{ matrix.python-version }} + run: tox -e py${{ matrix.python-version }} -- --runslow env: PYTHONUNBUFFERED: "True" diff --git a/requirements_test.txt b/requirements_test.txt index e340b80..bda4a72 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -12,7 +12,7 @@ galaxy-tool-util galaxy-web-stack galaxy-config galaxy-web-framework -celery[pytest] # required for the resubmission tests +pytest-celery # required for the resubmission tests -e ".[test]" # The following packages are needed for resubmit integration testing (except galaxy-app) galaxy-job-execution diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..e446d0a --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,21 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--runslow", action="store_true", default=False, help="run slow tests" + ) + + +def pytest_configure(config): + config.addinivalue_line("markers", "slow: mark test as slow to run") + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--runslow"): + # --runslow given in cli: do not skip slow tests + return + skip_slow = pytest.mark.skip(reason="need --runslow option to run") + for item in items: + if "slow" in item.keywords: + item.add_marker(skip_slow) diff --git a/tests/test_mapper_resubmit.py b/tests/test_mapper_resubmit.py index 07e1fdb..9af20af 100644 --- a/tests/test_mapper_resubmit.py +++ b/tests/test_mapper_resubmit.py @@ -1,4 +1,7 @@ import os + +import pytest + from galaxy_test.driver.integration_util import IntegrationTestCase from galaxy.webapps.base import webapp @@ -31,9 +34,10 @@ def _assert_job_fails(self, tool_id="exit_code_oom", resource_parameters=None): assert exception_thrown - # FIXME: Temporarily disable tests till https://github.com/galaxyproject/galaxy/issues/14021 is resolved. + @pytest.mark.slow def test_mapping_with_resubmission(self): self._assert_job_passes(tool_id="exit_code_oom_with_resubmit") + @pytest.mark.slow def test_mapping_without_resubmission(self): self._assert_job_fails(tool_id="exit_code_oom_no_resubmit")