ci: use IDF_PATH as pytest log dir

This commit is contained in:
Fu Hanxi
2022-04-02 16:47:58 +08:00
parent a2c8a676a0
commit 5e05a1f174
2 changed files with 19 additions and 6 deletions

View File

@@ -8,7 +8,7 @@
when: always when: always
paths: paths:
- XUNIT_RESULT.xml - XUNIT_RESULT.xml
- /tmp/pytest-embedded/ - pytest_embedded_log/
reports: reports:
junit: XUNIT_RESULT.xml junit: XUNIT_RESULT.xml
expire_in: 1 week expire_in: 1 week

View File

@@ -12,11 +12,11 @@
# #
# This is an experimental feature, and if you found any bug or have any question, please report to # This is an experimental feature, and if you found any bug or have any question, please report to
# https://github.com/espressif/pytest-embedded/issues # https://github.com/espressif/pytest-embedded/issues
import logging import logging
import os import os
import sys import sys
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from datetime import datetime
from fnmatch import fnmatch from fnmatch import fnmatch
from typing import Callable, List, Optional, Tuple from typing import Callable, List, Optional, Tuple
@@ -61,6 +61,19 @@ def item_marker_names(item: Item) -> List[str]:
############ ############
# Fixtures # # Fixtures #
############ ############
_TEST_SESSION_TMPDIR = os.path.join(
os.path.dirname(__file__),
'pytest_embedded_log',
datetime.now().strftime('%Y-%m-%d_%H-%M-%S'),
)
os.makedirs(_TEST_SESSION_TMPDIR, exist_ok=True)
@pytest.fixture(scope='session', autouse=True)
def session_tempdir() -> str:
return _TEST_SESSION_TMPDIR
@pytest.fixture @pytest.fixture
@parse_configuration @parse_configuration
def config(request: FixtureRequest) -> str: def config(request: FixtureRequest) -> str:
@@ -79,9 +92,7 @@ def test_case_name(request: FixtureRequest, target: str, config: str) -> str:
@pytest.fixture @pytest.fixture
@apply_count @apply_count
def build_dir( def build_dir(app_path: str, target: Optional[str], config: Optional[str]) -> str:
app_path: str, target: Optional[str], config: Optional[str]
) -> str:
""" """
Check local build dir with the following priority: Check local build dir with the following priority:
@@ -245,7 +256,9 @@ class IdfPytestEmbedded:
for _target in [*SUPPORTED_TARGETS, *PREVIEW_TARGETS]: for _target in [*SUPPORTED_TARGETS, *PREVIEW_TARGETS]:
item.add_marker(_target) item.add_marker(_target)
# FIXME: temporarily modify the s3 runner tag "generic" to "s3_generic" due to the deep sleep bug # FIXME: temporarily modify the s3 runner tag "generic" to "s3_generic" due to the deep sleep bug
if 'generic' in item_marker_names(item) and 'esp32s3' in item_marker_names(item): if 'generic' in item_marker_names(item) and 'esp32s3' in item_marker_names(
item
):
item.add_marker('generic_s3_fixme') item.add_marker('generic_s3_fixme')
# filter all the test cases with "--target" # filter all the test cases with "--target"