ci: add test marks linter

This commit is contained in:
igor.udot
2024-12-02 10:47:32 +08:00
parent 47df2ed524
commit bbcef0570d
13 changed files with 663 additions and 30 deletions

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=W0621 # redefined-outer-name
#
@ -39,8 +39,14 @@ from dynamic_pipelines.constants import TEST_RELATED_APPS_DOWNLOAD_URLS_FILENAME
from idf_ci.app import import_apps_from_txt
from idf_ci.uploader import AppDownloader, AppUploader
from idf_ci_utils import IDF_PATH, idf_relpath
from idf_pytest.constants import DEFAULT_SDKCONFIG, ENV_MARKERS, SPECIAL_MARKERS, TARGET_MARKERS, PytestCase, \
DEFAULT_LOGDIR
from idf_pytest.constants import (
DEFAULT_SDKCONFIG,
ENV_MARKERS,
SPECIAL_MARKERS,
TARGET_MARKERS,
PytestCase,
DEFAULT_LOGDIR,
)
from idf_pytest.plugin import IDF_PYTEST_EMBEDDED_KEY, ITEM_PYTEST_CASE_KEY, IdfPytestEmbedded
from idf_pytest.utils import format_case_id
from pytest_embedded.plugin import multi_dut_argument, multi_dut_fixture
@ -318,7 +324,7 @@ def check_performance(idf_path: str) -> t.Callable[[str, float, str], None]:
def _find_perf_item(operator: str, path: str) -> float:
with open(path, encoding='utf-8') as f:
data = f.read()
match = re.search(fr'#define\s+IDF_PERFORMANCE_{operator}_{item.upper()}\s+([\d.]+)', data)
match = re.search(rf'#define\s+IDF_PERFORMANCE_{operator}_{item.upper()}\s+([\d.]+)', data)
return float(match.group(1)) # type: ignore
def _check_perf(operator: str, standard_value: float) -> None:
@ -420,6 +426,12 @@ def pytest_addoption(parser: pytest.Parser) -> None:
def pytest_configure(config: Config) -> None:
from pytest_embedded_idf.utils import supported_targets, preview_targets
from idf_pytest.constants import SUPPORTED_TARGETS, PREVIEW_TARGETS
supported_targets.set(SUPPORTED_TARGETS)
preview_targets.set(PREVIEW_TARGETS)
# cli option "--target"
target = [_t.strip().lower() for _t in (config.getoption('target', '') or '').split(',') if _t.strip()]