ci: publish category failures when tests cannot collect
This commit is contained in:
parent
d2c36ccaf6
commit
73f11051bd
@ -86,12 +86,15 @@ current_target = ''
|
||||
|
||||
manifest_path = pathlib.Path('tests/test-taxonomy-manifest.json')
|
||||
category_by_path = {}
|
||||
test_categories = set()
|
||||
if manifest_path.exists():
|
||||
for item in json.loads(manifest_path.read_text(encoding='utf-8')):
|
||||
path = item.get('new', '')
|
||||
category = item.get('category', '')
|
||||
if path and category:
|
||||
category_by_path[path] = category
|
||||
if category not in {'fixtures', 'golden', 'helpers'}:
|
||||
test_categories.add(category)
|
||||
|
||||
def category_for_target(target: str) -> str:
|
||||
if target in category_by_path:
|
||||
@ -124,6 +127,14 @@ for raw in log_path.read_text(encoding='utf-8', errors='replace').splitlines():
|
||||
counts[key] += int(match.group(key))
|
||||
|
||||
outcome = 'ok' if status == 0 else 'failed'
|
||||
if status != 0 and not test_cases:
|
||||
fallback_categories = sorted(test_categories) or ['uncategorized']
|
||||
for category in fallback_categories:
|
||||
test_cases.append({
|
||||
'test': '__test_collection_failed__',
|
||||
'category': category,
|
||||
'status': 'failed',
|
||||
})
|
||||
summary = {
|
||||
'suite': 'lesavka',
|
||||
'branch': branch,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user