From 4783e550390bc5d82edc2258dca678842e03ad83 Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Wed, 6 Jul 2022 23:31:27 -0300 Subject: [PATCH] ci/lava: Add `slow` pytest marker Mark test_full_yaml_log with this new marker to be easily run by the developers. Make `debian-testing` skip this test with `not slow` marker hint. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/lava/lava-pytest.sh | 3 ++- .gitlab-ci/tests/conftest.py | 5 +++++ .gitlab-ci/tests/test_lava_job_submitter.py | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) 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