mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci: different test case name with different params
This commit is contained in:
parent
e48ca24364
commit
24b2e0a56d
13
conftest.py
13
conftest.py
@ -19,6 +19,7 @@ import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
from typing import Callable, Optional
|
||||
|
||||
@ -87,7 +88,17 @@ def test_func_name(request: FixtureRequest) -> str:
|
||||
@pytest.fixture
|
||||
def test_case_name(request: FixtureRequest, target: str, config: str) -> str:
|
||||
is_qemu = request._pyfuncitem.get_closest_marker('qemu') is not None
|
||||
return format_case_id(target, config, request.node.originalname, is_qemu=is_qemu) # type: ignore
|
||||
if hasattr(request._pyfuncitem, 'callspec'):
|
||||
params = deepcopy(request._pyfuncitem.callspec.params) # type: ignore
|
||||
else:
|
||||
params = {}
|
||||
|
||||
filtered_params = {}
|
||||
for k, v in params.items():
|
||||
if k not in request.session._fixturemanager._arg2fixturedefs: # type: ignore
|
||||
filtered_params[k] = v # not fixture ones
|
||||
|
||||
return format_case_id(target, config, request.node.originalname, is_qemu=is_qemu, params=filtered_params) # type: ignore
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -9,7 +9,7 @@ from xml.etree import ElementTree as ET
|
||||
from .constants import TARGET_MARKERS
|
||||
|
||||
|
||||
def format_case_id(target: t.Optional[str], config: t.Optional[str], case: str, is_qemu: bool = False) -> str:
|
||||
def format_case_id(target: t.Optional[str], config: t.Optional[str], case: str, is_qemu: bool = False, params: t.Optional[dict] = None) -> str:
|
||||
parts = []
|
||||
if target:
|
||||
parts.append((str(target) + '_qemu') if is_qemu else str(target))
|
||||
@ -17,6 +17,9 @@ def format_case_id(target: t.Optional[str], config: t.Optional[str], case: str,
|
||||
parts.append(str(config))
|
||||
parts.append(case)
|
||||
|
||||
if params:
|
||||
parts.append(str(params))
|
||||
|
||||
return '.'.join(parts)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user