ci: sort pytest test cases by app path

pull/12486/head
Fu Hanxi 2023-10-20 13:15:24 +02:00
rodzic d7aa99ac2d
commit d2f5f3549e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 19399699CF3C4B16
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -49,7 +49,7 @@ class IdfPytestEmbedded:
# 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
if not hasattr(item, 'callspec'):
raise ValueError(f'Function {item} does not have params')
return default
return item.callspec.params.get(key, default) or default
@ -177,7 +177,11 @@ class IdfPytestEmbedded:
# finally!
filtered_items.append(item)
items[:] = filtered_items[:]
# sort the test cases with (app folder, config)
items[:] = sorted(
filtered_items,
key=lambda x: (os.path.dirname(x.path), self.get_param(x, 'config', DEFAULT_SDKCONFIG))
)
def pytest_report_collectionfinish(self, items: t.List[Function]) -> None:
for item in items: