forked from espressif/esp-idf
Merge branch 'fix/pytest_session_dir_v5.1' into 'release/v5.1'
ci: apply new fix in pytest-embedded 1.10 (v5.1) See merge request espressif/esp-idf!30678
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -96,4 +96,6 @@ dependencies.lock
|
||||
managed_components
|
||||
|
||||
# pytest log
|
||||
pytest-embedded/
|
||||
# legacy one
|
||||
pytest_embedded_log/
|
||||
|
@@ -307,7 +307,7 @@ test_pytest_qemu:
|
||||
when: always
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest_embedded_log/
|
||||
- pytest-embedded/
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
expire_in: 1 week
|
||||
@@ -332,7 +332,7 @@ test_pytest_linux:
|
||||
when: always
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest_embedded_log/
|
||||
- pytest-embedded/
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
expire_in: 1 week
|
||||
|
@@ -19,7 +19,7 @@
|
||||
when: always
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest_embedded_log/
|
||||
- pytest-embedded/
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
expire_in: 1 week
|
||||
|
@@ -104,10 +104,10 @@ repos:
|
||||
name: Check type annotations in python files
|
||||
entry: tools/ci/check_type_comments.py
|
||||
additional_dependencies:
|
||||
- 'mypy==0.940'
|
||||
- 'mypy-extensions==0.4.3'
|
||||
- 'types-setuptools==57.4.14'
|
||||
- 'types-PyYAML==0.1.9'
|
||||
- 'mypy'
|
||||
- 'mypy-extensions'
|
||||
- 'types-setuptools'
|
||||
- 'types-PyYAML'
|
||||
exclude: >
|
||||
(?x)^(
|
||||
.*_pb2.py
|
||||
|
16
conftest.py
16
conftest.py
@@ -15,7 +15,6 @@ import os
|
||||
import re
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from datetime import datetime
|
||||
from fnmatch import fnmatch
|
||||
from typing import Callable
|
||||
from typing import List
|
||||
@@ -183,7 +182,7 @@ def item_skip_targets(item: Item) -> List[str]:
|
||||
# temp markers should always use keyword arguments `targets` and `reason`
|
||||
if not temp_marker.kwargs.get('targets') or not temp_marker.kwargs.get('reason'):
|
||||
raise ValueError(
|
||||
f'`{marker_name}` should always use keyword arguments `targets` and `reason`. '
|
||||
f'`{marker_name}` should always use keyword arguments `targets` and `reason`. ' # noqa
|
||||
f'For example: '
|
||||
f'`@pytest.mark.{marker_name}(targets=["esp32"], reason="IDF-xxxx, will fix it ASAP")`'
|
||||
)
|
||||
@@ -227,15 +226,10 @@ def idf_path() -> str:
|
||||
return os.path.dirname(__file__)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
def session_tempdir() -> str:
|
||||
_tmpdir = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'pytest_embedded_log',
|
||||
datetime.now().strftime('%Y-%m-%d_%H-%M-%S'),
|
||||
)
|
||||
os.makedirs(_tmpdir, exist_ok=True)
|
||||
return _tmpdir
|
||||
@pytest.fixture(scope='session')
|
||||
def session_root_logdir(idf_path: str) -> str:
|
||||
"""Session scoped log dir for pytest-embedded"""
|
||||
return idf_path
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@@ -13,6 +13,7 @@ addopts =
|
||||
--logfile-extension ".txt"
|
||||
--check-duplicates y
|
||||
--ignore-glob "*/managed_components/*"
|
||||
--ignore pytest-embedded
|
||||
|
||||
# ignore DeprecationWarning
|
||||
filterwarnings =
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
from sys import exit
|
||||
@@ -30,7 +29,7 @@ def types_valid_ignored_rules(file_name): # type: (str) -> bool
|
||||
"""
|
||||
Run Mypy check with rules for ignore list on the given file, return TRUE if Mypy check passes
|
||||
"""
|
||||
mypy_exit_code = subprocess.call('mypy {} --allow-untyped-defs'.format(file_name), shell=True)
|
||||
mypy_exit_code = subprocess.call('mypy {} --python-version 3.7 --allow-untyped-defs'.format(file_name), shell=True)
|
||||
return not bool(mypy_exit_code)
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# internal use only for CI
|
||||
# some CI related util functions
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import contextlib
|
||||
@@ -13,7 +13,12 @@ import sys
|
||||
from contextlib import redirect_stdout
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Set, Union
|
||||
from typing import Any
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from typing import Set
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Union
|
||||
|
||||
try:
|
||||
from idf_py_actions.constants import PREVIEW_TARGETS, SUPPORTED_TARGETS
|
||||
@@ -25,7 +30,7 @@ except ImportError:
|
||||
if TYPE_CHECKING:
|
||||
from _pytest.python import Function
|
||||
|
||||
IDF_PATH = os.path.abspath(os.getenv('IDF_PATH', os.path.join(os.path.dirname(__file__), '..', '..')))
|
||||
IDF_PATH: str = os.path.abspath(os.getenv('IDF_PATH', os.path.join(os.path.dirname(__file__), '..', '..')))
|
||||
|
||||
|
||||
def get_submodule_dirs(full_path: bool = False) -> List[str]:
|
||||
|
Reference in New Issue
Block a user