Skip to content

Commit

Permalink
Merge pull request #66 from galaxyproject/add_optional_slow_tests
Browse files Browse the repository at this point in the history
Add optional slow tests
  • Loading branch information
nuwang authored Mar 26, 2024
2 parents a99ec5a + af1d0c2 commit d5cb97b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ galaxy-tool-util
galaxy-web-stack
galaxy-config
galaxy-web-framework
pytest-celery # required for the resubmission tests
galaxy-web-apps
-e ".[test]"
# The following packages are needed for resubmit integration testing (except galaxy-app)
Expand Down
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 10 additions & 6 deletions tests/test_mapper_resubmit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os

import pytest

from galaxy_test.driver.integration_util import IntegrationTestCase
from galaxy.webapps.base import webapp

Expand Down Expand Up @@ -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.
# def test_mapping_with_resubmission(self):
# self._assert_job_passes(tool_id="exit_code_oom_with_resubmit")
#
# def test_mapping_without_resubmission(self):
# self._assert_job_fails(tool_id="exit_code_oom_no_resubmit")
@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")

0 comments on commit d5cb97b

Please sign in to comment.