Skip to content

Commit d5b23fc

Browse files
committed
Merge branch 'ci/fixes'
2 parents 69a2397 + 25a3a47 commit d5b23fc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/scripts/generate_missing_junits.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
8282
expected: dict[tuple[str, str, str, str], int] = {}
8383
if not build_root.exists():
8484
return expected
85+
print(f"[DEBUG] Scanning build artifacts in: {build_root}", file=sys.stderr)
8586
for artifact_dir in build_root.iterdir():
8687
if not artifact_dir.is_dir():
8788
continue
@@ -90,6 +91,7 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
9091
continue
9192
target = m.group(1)
9293
test_type = m.group(2)
94+
print(f"[DEBUG] Artifact group target={target} type={test_type} dir={artifact_dir}", file=sys.stderr)
9395
# Walk build*.tmp directories which contain ci.yml and sdkconfig
9496
for p in artifact_dir.rglob("*.tmp"):
9597
if not p.is_dir() or not re.search(r"build\d*\.tmp$", str(p)):
@@ -139,14 +141,17 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
139141
exp_runs = fqbn_counts.get(target, 0) or 1
140142
for plat in allowed_platforms:
141143
expected[(plat, target, test_type, sketch)] = max(expected.get((plat, target, test_type, sketch), 0), exp_runs)
144+
print(f"[DEBUG] Expected: plat={plat} target={target} type={test_type} sketch={sketch} runs={exp_runs}", file=sys.stderr)
142145
return expected
143146

144147

145148
def scan_executed_xml(xml_root: Path) -> dict[tuple[str, str, str, str], int]:
146149
"""Return executed counts per (platform, target, type, sketch)."""
147150
counts: dict[tuple[str, str, str, str], int] = {}
148151
if not xml_root.exists():
152+
print(f"[DEBUG] Results root not found: {xml_root}", file=sys.stderr)
149153
return counts
154+
print(f"[DEBUG] Scanning executed XMLs in: {xml_root}", file=sys.stderr)
150155
for xml_path in xml_root.rglob("*.xml"):
151156
if not xml_path.is_file():
152157
continue
@@ -170,6 +175,7 @@ def scan_executed_xml(xml_root: Path) -> dict[tuple[str, str, str, str], int]:
170175
target = parts[t_idx + 3]
171176
key = (platform, target, test_type, sketch)
172177
counts[key] = counts.get(key, 0) + 1
178+
print(f"[DEBUG] Executed entries discovered: {len(counts)}", file=sys.stderr)
173179
return counts
174180

175181

@@ -213,6 +219,7 @@ def main():
213219

214220
expected = expected_from_artifacts(build_root) # (platform, target, type, sketch) -> expected_count
215221
executed = scan_executed_xml(results_root) # (platform, target, type, sketch) -> count
222+
print(f"[DEBUG] Expected entries computed: {len(expected)}", file=sys.stderr)
216223

217224
# Filter expected by enabled platforms and target/type matrices
218225
enabled_plats = set()
@@ -234,6 +241,7 @@ def main():
234241
continue
235242
got = executed.get((plat, target, test_type, sketch), 0)
236243
if got < exp_count:
244+
print(f"[DEBUG] Missing: plat={plat} target={target} type={test_type} sketch={sketch} expected={exp_count} got={got}", file=sys.stderr)
237245
write_missing_xml(out_root, plat, target, test_type, sketch, exp_count - got)
238246
missing_total += (exp_count - got)
239247

0 commit comments

Comments
 (0)