Skip to content

Commit e7d61dd

Browse files
committed
Merge branch 'ci/fixes'
2 parents 8a19a4b + 07ae1d2 commit e7d61dd

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

.github/scripts/generate_missing_junits.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ def scan_executed_xml(xml_root: Path, valid_types: set[str]) -> dict[tuple[str,
195195
sketch = parts[t_idx + 1]
196196
target = parts[t_idx + 2]
197197
key = (platform, target, test_type, sketch)
198-
counts[key] = counts.get(key, 0) + 1
198+
old_count = counts.get(key, 0)
199+
counts[key] = old_count + 1
200+
print(f"[DEBUG] Executed XML #{old_count + 1}: plat={platform} target={target} type={test_type} sketch={sketch} file={xml_path.name}", file=sys.stderr)
199201
print(f"[DEBUG] Executed entries discovered: {len(counts)}", file=sys.stderr)
200202
return counts
201203

@@ -266,22 +268,45 @@ def main():
266268
if qemu_enabled:
267269
enabled_plats.add("qemu")
268270

269-
target_set = set(hw_targets + wokwi_targets + qemu_targets)
270-
type_set = set(hw_types + wokwi_types + qemu_types)
271+
# Build platform-specific target and type sets
272+
plat_targets = {
273+
"hardware": set(hw_targets),
274+
"wokwi": set(wokwi_targets),
275+
"qemu": set(qemu_targets),
276+
}
277+
plat_types = {
278+
"hardware": set(hw_types),
279+
"wokwi": set(wokwi_types),
280+
"qemu": set(qemu_types),
281+
}
271282

272283
missing_total = 0
284+
extra_total = 0
273285
for (plat, target, test_type, sketch), exp_count in expected.items():
274286
if plat not in enabled_plats:
275287
continue
276-
if target not in target_set or test_type not in type_set:
288+
# Check if target and type are valid for this specific platform
289+
if target not in plat_targets.get(plat, set()):
290+
continue
291+
if test_type not in plat_types.get(plat, set()):
277292
continue
278293
got = executed.get((plat, target, test_type, sketch), 0)
279294
if got < exp_count:
280295
print(f"[DEBUG] Missing: plat={plat} target={target} type={test_type} sketch={sketch} expected={exp_count} got={got}", file=sys.stderr)
281296
write_missing_xml(out_root, plat, target, test_type, sketch, exp_count - got)
282297
missing_total += (exp_count - got)
298+
elif got > exp_count:
299+
print(f"[DEBUG] Extra runs: plat={plat} target={target} type={test_type} sketch={sketch} expected={exp_count} got={got}", file=sys.stderr)
300+
extra_total += (got - exp_count)
301+
302+
# Check for executed tests that were not expected at all
303+
for (plat, target, test_type, sketch), got in executed.items():
304+
if (plat, target, test_type, sketch) not in expected:
305+
print(f"[DEBUG] Unexpected test: plat={plat} target={target} type={test_type} sketch={sketch} got={got} (not in expected)", file=sys.stderr)
283306

284307
print(f"Generated {missing_total} placeholder JUnit files for missing runs.", file=sys.stderr)
308+
if extra_total > 0:
309+
print(f"WARNING: {extra_total} extra test runs detected (more than expected).", file=sys.stderr)
285310

286311

287312
if __name__ == "__main__":

.github/workflows/tests_results.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,6 @@ jobs:
263263
rm -rf artifacts $REPORT_FILE
264264
mv -f ./unity_results.json ./runtime-test-results/unity_results.json
265265
touch $REPORT_FILE
266-
# Download original build artifacts to access ci.yml files stored next to compiled binaries
267-
mkdir -p ./runtime-test-results/build_artifacts
268-
gh run download ${{ needs.get-artifacts.outputs.original_run_id }} --name "test-bin-*" --dir ./runtime-test-results/build_artifacts || true
269266
wget https://raw.githubusercontent.com/${{ github.repository }}/master/.github/scripts/runtime_table_generator.py -O ./runtime-test-results/runtime_table_generator.py
270267
python3 ./runtime-test-results/runtime_table_generator.py ./runtime-test-results/unity_results.json ${{ needs.get-artifacts.outputs.original_sha }} >> $REPORT_FILE
271268
mv -f ./test_results.json ./runtime-test-results/test_results.json

0 commit comments

Comments
 (0)