diff --git a/.gitlab-ci/lava/lava-pytest.sh b/.gitlab-ci/lava/lava-pytest.sh index 311a2c4530c..ac0ef80c0a0 100755 --- a/.gitlab-ci/lava/lava-pytest.sh +++ b/.gitlab-ci/lava/lava-pytest.sh @@ -31,4 +31,5 @@ TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests PYTHONPATH="${TEST_DIR}:${PYTHONPATH}" python3 -m \ pytest "${TEST_DIR}" \ -W ignore::DeprecationWarning \ - --junitxml=artifacts/ci_scripts_report.xml + --junitxml=artifacts/ci_scripts_report.xml \ + -m 'not slow' diff --git a/.gitlab-ci/tests/conftest.py b/.gitlab-ci/tests/conftest.py index f57d1c0775d..866864d6d56 100644 --- a/.gitlab-ci/tests/conftest.py +++ b/.gitlab-ci/tests/conftest.py @@ -7,6 +7,11 @@ from freezegun import freeze_time from .lava.helpers import generate_testsuite_result, jobs_logs_response +def pytest_configure(config): + config.addinivalue_line( + "markers", "slow: marks tests as slow (deselect with '-m \"not slow\"')" + ) + @pytest.fixture def mock_sleep(): """Mock time.sleep to make test faster""" diff --git a/.gitlab-ci/tests/test_lava_job_submitter.py b/.gitlab-ci/tests/test_lava_job_submitter.py index 249f3386a3f..5076effa9b0 100644 --- a/.gitlab-ci/tests/test_lava_job_submitter.py +++ b/.gitlab-ci/tests/test_lava_job_submitter.py @@ -275,7 +275,9 @@ def test_parse_job_result_from_log(message, expectation, mock_proxy): assert job.status == expectation -@pytest.mark.skip(reason="Integration test. Needs a LAVA log raw file at /tmp/log.yaml") +@pytest.mark.slow( + reason="Slow and sketchy test. Needs a LAVA log raw file at /tmp/log.yaml" +) def test_full_yaml_log(mock_proxy, frozen_time): import itertools import random