Mesa (main): ci/lava: Add `slow` pytest marker

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 8 12:54:57 UTC 2022


Module: Mesa
Branch: main
Commit: 4783e550390bc5d82edc2258dca678842e03ad83
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4783e550390bc5d82edc2258dca678842e03ad83

Author: Guilherme Gallo <guilherme.gallo at collabora.com>
Date:   Wed Jul  6 23:31:27 2022 -0300

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 <guilherme.gallo at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17389>

---

 .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
 
 
- at pytest.mark.skip(reason="Integration test. Needs a LAVA log raw file at /tmp/log.yaml")
+ at 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



More information about the mesa-commit mailing list