From 97725036dbb8f8ae2191fe1d7d2bff8c6284d8c9 Mon Sep 17 00:00:00 2001 From: Aleksei Apaseev Date: Thu, 30 Jun 2022 18:19:57 +0800 Subject: [PATCH] ci: add support nightly jobs for pytest cases --- conftest.py | 10 ++++++++++ pytest.ini | 1 + 2 files changed, 11 insertions(+) diff --git a/conftest.py b/conftest.py index ec1534d4a8..5925c531fe 100644 --- a/conftest.py +++ b/conftest.py @@ -315,6 +315,16 @@ class IdfPytestEmbedded: for _target in [*SUPPORTED_TARGETS, *PREVIEW_TARGETS]: item.add_marker(_target) + # filter all the test cases with "nightly_run" marker + if os.getenv('NIGHTLY_RUN') == '1': + items[:] = [ + item for item in items if 'nightly_run' in item_marker_names(item) + ] + else: + items[:] = [ + item for item in items if 'nightly_run' not in item_marker_names(item) + ] + # filter all the test cases with "--target" if self.target: items[:] = [ diff --git a/pytest.ini b/pytest.ini index 003fefc3e2..0f5e9134dd 100644 --- a/pytest.ini +++ b/pytest.ini @@ -29,6 +29,7 @@ markers = # env markers generic: tests should be run on generic runners + nightly_run: tests should be executed as part of the nightly trigger pipeline flash_suspend: support flash suspend feature ip101: connected via wired 10/100M ethernet lan8720: connected via LAN8720 ethernet transceiver