Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional slow tests #66

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Loading