Skip to content

Commit dcbd0cd

Browse files
committed
Merge branch 'ci/fixes'
2 parents 833fbe5 + 9a6213f commit dcbd0cd

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/scripts/generate_missing_junits.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
140140
return expected
141141

142142

143-
def scan_executed_xml(xml_root: Path) -> dict[tuple[str, str, str, str], int]:
144-
"""Return executed counts per (platform, target, type, sketch)."""
143+
def scan_executed_xml(xml_root: Path, valid_types: set[str]) -> dict[tuple[str, str, str, str], int]:
144+
"""Return executed counts per (platform, target, type, sketch).
145+
Type/sketch/target are inferred from .../<type>/<sketch>/<target>/<file>.xml
146+
"""
145147
counts: dict[tuple[str, str, str, str], int] = {}
146148
if not xml_root.exists():
147149
print(f"[DEBUG] Results root not found: {xml_root}", file=sys.stderr)
@@ -156,18 +158,17 @@ def scan_executed_xml(xml_root: Path) -> dict[tuple[str, str, str, str], int]:
156158
platform = "wokwi"
157159
elif "test-results-qemu-" in rel:
158160
platform = "qemu"
159-
# Expect tests/<type>/<sketch>/<target>/<sketch>.xml
160-
# Find 'tests' segment
161+
# Expect .../<type>/<sketch>/<target>/*.xml
161162
parts = xml_path.parts
162-
try:
163-
t_idx = parts.index("tests")
164-
except ValueError:
165-
continue
166-
if t_idx + 4 >= len(parts):
163+
t_idx = -1
164+
for i, p in enumerate(parts):
165+
if p in valid_types:
166+
t_idx = i
167+
if t_idx == -1 or t_idx + 3 >= len(parts):
167168
continue
168-
test_type = parts[t_idx + 1]
169-
sketch = parts[t_idx + 2]
170-
target = parts[t_idx + 3]
169+
test_type = parts[t_idx]
170+
sketch = parts[t_idx + 1]
171+
target = parts[t_idx + 2]
171172
key = (platform, target, test_type, sketch)
172173
counts[key] = counts.get(key, 0) + 1
173174
print(f"[DEBUG] Executed entries discovered: {len(counts)}", file=sys.stderr)
@@ -227,7 +228,8 @@ def main():
227228
qemu_types = parse_array(os.environ.get("QEMU_TYPES", "[]"))
228229

229230
expected = expected_from_artifacts(build_root) # (platform, target, type, sketch) -> expected_count
230-
executed = scan_executed_xml(results_root) # (platform, target, type, sketch) -> count
231+
executed_types = set(hw_types + wokwi_types + qemu_types)
232+
executed = scan_executed_xml(results_root, executed_types) # (platform, target, type, sketch) -> count
231233
print(f"[DEBUG] Expected entries computed: {len(expected)}", file=sys.stderr)
232234

233235
# Filter expected by enabled platforms and target/type matrices

.github/workflows/tests_results.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,8 @@ jobs:
142142
QEMU_TARGETS: ${{ needs.get-artifacts.outputs.qemu_targets }}
143143
QEMU_TYPES: ${{ needs.get-artifacts.outputs.qemu_types }}
144144
run: |
145-
ls -laR ./artifacts
146-
echo "======================================================================"
147-
ls -laR ./build_artifacts
148-
echo "======================================================================"
145+
ls -la ./artifacts
146+
ls -la ./build_artifacts
149147
pip3 install pyyaml
150148
wget https://raw.githubusercontent.com/${{ github.repository }}/master/.github/scripts/generate_missing_junits.py -O ./generate_missing_junits.py
151149
python3 ./generate_missing_junits.py ./build_artifacts ./artifacts ./test_errors

0 commit comments

Comments
 (0)