From 03384de7506d5e6461fee57d46c9f3d4b9da5b89 Mon Sep 17 00:00:00 2001
From: Mohammad Torkashvand <mohammad.torkashvand@geant.org>
Date: Tue, 22 Oct 2024 14:23:07 +0200
Subject: [PATCH] fix Skipping coverage report for jenkins

---
 test/conftest.py | 6 ------
 tox.ini          | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/test/conftest.py b/test/conftest.py
index 1cf0d399..ed4cb631 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -49,12 +49,6 @@ from test.fixtures import (  # noqa: F401
 logging.getLogger("faker.factory").setLevel(logging.WARNING)
 
 
-def pytest_collection_modifyitems(config, items):
-    if bool(os.environ.get("SKIP_ALL_TESTS")):
-        for item in items:
-            item.add_marker(pytest.mark.skip(reason="Skipped due to SKIP_ALL_TESTS env variable"))
-
-
 class UseJuniperSide(strEnum):
     """Define on tests on which side to use Juniper router."""
 
diff --git a/tox.ini b/tox.ini
index 985eddf7..a6d04258 100644
--- a/tox.ini
+++ b/tox.ini
@@ -20,7 +20,7 @@ commands =
     ruff check --respect-gitignore --preview .
     ruff format --respect-gitignore --preview --check .
     mypy .
-    sh -c 'SKIP_ALL_TESTS=${SKIP_ALL_TESTS:-0}; if [ "$SKIP_ALL_TESTS" = "1" ]; then echo "Skipping coverage report"; else pytest --cov=gso --cov-report=xml --cov-report=html --cov-fail-under=85 -n auto; fi'
+    sh -c 'if [ $SKIP_ALL_TESTS = 1 ]; then echo "Skipping coverage report"; else pytest --cov=gso --cov-report=xml --cov-report=html --cov-fail-under=85 -n auto {posargs}; fi'
 
 allowlist_externals =
     sh
-- 
GitLab