@@ -92,24 +92,18 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
9292 target = m .group (1 )
9393 test_type = m .group (2 )
9494 print (f"[DEBUG] Artifact group target={ target } type={ test_type } dir={ artifact_dir } " , file = sys .stderr )
95- # Walk build*.tmp directories which contain ci.yml and sdkconfig
96- for p in artifact_dir .rglob ("*.tmp " ):
97- if not p . is_dir () or not re . search ( r"build\d*\.tmp$" , str ( p ) ):
95+ # Locate ci.yml next to build*.tmp folders and derive sketch/target
96+ for ci_path in artifact_dir .rglob ("ci.yml " ):
97+ if not ci_path . is_file ( ):
9898 continue
99- # Infer sketch name from path
100- parts = p .parts
101- try :
102- idx = parts .index (".arduino" )
103- except ValueError :
104- continue
105- if idx + 4 >= len (parts ) or parts [idx + 1 ] != "tests" :
99+ build_tmp = ci_path .parent
100+ if not re .search (r"build\d*\.tmp$" , build_tmp .name ):
106101 continue
107- sketch_target = parts [ idx + 2 ]
108- sketch = parts [ idx + 3 ]
109- if sketch_target != target :
102+ sketch = build_tmp . parent . name
103+ target_guess = build_tmp . parent . parent . name if build_tmp . parent . parent else ""
104+ if target_guess != target :
110105 continue
111- ci_path = p / "ci.yml"
112- sdk_path = p / "sdkconfig"
106+ sdk_path = build_tmp / "sdkconfig"
113107 try :
114108 ci_text = ci_path .read_text (encoding = "utf-8" ) if ci_path .exists () else ""
115109 except Exception :
@@ -136,6 +130,7 @@ def expected_from_artifacts(build_root: Path) -> dict[tuple[str, str, str, str],
136130 "requires_any" : ci .get ("requires_any" ) or [],
137131 }
138132 if not _sdkconfig_meets (minimal , sdk_text ):
133+ print (f"[DEBUG] Skip (requirements not met): target={ target } type={ test_type } sketch={ sketch } " , file = sys .stderr )
139134 continue
140135 # Expected runs per target driven by fqbn count; default 1 when 0
141136 exp_runs = fqbn_counts .get (target , 0 ) or 1
0 commit comments