(
target: str, archs: Set[str], status: Dict[str, Dict[str, str]],
workspace: str)
| 195 | |
| 196 | |
| 197 | def _dump_failed_build_logs( |
| 198 | target: str, archs: Set[str], status: Dict[str, Dict[str, str]], |
| 199 | workspace: str) -> None: |
| 200 | logs_list = glob.glob(join(workspace, f'snapcraft-{target}-*.txt')) |
| 201 | for arch in archs: |
| 202 | result = status[target][arch] |
| 203 | |
| 204 | if result != 'Succeeded': |
| 205 | failures = True |
| 206 | |
| 207 | # log name is no longer set deterministically as target_arch.txt |
| 208 | # this will still result in a single output though, as we're filtering |
| 209 | # by target above and arch here |
| 210 | build_output_path = [log_name for log_name in logs_list if arch in log_name] |
| 211 | if not build_output_path: |
| 212 | build_output = 'No output has been dumped by snapcraft remote-build.' |
| 213 | else: |
| 214 | with open(build_output_path[0]) as file_h: |
| 215 | build_output = file_h.read() |
| 216 | |
| 217 | print(f'Output for failed build target={target} arch={arch}') |
| 218 | print('-------------------------------------------') |
| 219 | print(build_output) |
| 220 | print('-------------------------------------------') |
| 221 | print() |
| 222 | |
| 223 | |
| 224 | def _dump_results(archs: Set[str], status: Dict[str, Dict[str, str]]) -> None: |
no test coverage detected