mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 06:34:34 +02:00
ci(pytest): reorder test sequence to run tests faster
This commit is contained in:
@@ -152,11 +152,16 @@ def pytest_collection_modifyitems(config: Config, items: List[Function]) -> None
|
|||||||
if not target:
|
if not target:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# sort by file path and callspec.config
|
||||||
|
# implement like this since this is a limitation of pytest, couldn't get fixture values while collecting
|
||||||
|
# https://github.com/pytest-dev/pytest/discussions/9689
|
||||||
def _get_param_config(_item: Function) -> str:
|
def _get_param_config(_item: Function) -> str:
|
||||||
if hasattr(_item, 'callspec'):
|
if hasattr(_item, 'callspec'):
|
||||||
return _item.callspec.params.get('config', DEFAULT_SDKCONFIG) # type: ignore
|
return _item.callspec.params.get('config', DEFAULT_SDKCONFIG) # type: ignore
|
||||||
return DEFAULT_SDKCONFIG
|
return DEFAULT_SDKCONFIG
|
||||||
|
|
||||||
|
items.sort(key=lambda x: (os.path.dirname(x.path), _get_param_config(x)))
|
||||||
|
|
||||||
# add markers for special markers
|
# add markers for special markers
|
||||||
for item in items:
|
for item in items:
|
||||||
if 'supported_targets' in item_marker_names(item):
|
if 'supported_targets' in item_marker_names(item):
|
||||||
|
Reference in New Issue
Block a user