From 7582548b8c86647658b3b7d98bc4afb8c096014c Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 18 Nov 2019 17:55:58 +0100 Subject: [PATCH] [gitlab-ci] Run slow tests only in ubuntu-mpi build --- tests/pytest/conftest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/pytest/conftest.py b/tests/pytest/conftest.py index 9eb2f24e..bb692b22 100644 --- a/tests/pytest/conftest.py +++ b/tests/pytest/conftest.py @@ -13,7 +13,15 @@ def pytest_configure(config): def pytest_collection_modifyitems(config, items): - if not (('RUN_SLOW_TESTS' in os.environ and os.environ['RUN_SLOW_TESTS']) or config.getoption("--runslow")): + import platform + + run_slow_tests = config.getoption("--runslow") + + # gitlab-ci: run slow tests only on Linux + if platform.system()=='Linux' and 'RUN_SLOW_TESTS' in os.environ and os.environ['RUN_SLOW_TESTS']: + run_slow_tests = True + + if not run_slow_tests: skip_slow = pytest.mark.skip(reason="need --runslow option to run") for item in items: if "slow" in item.keywords: