| 356 | } |
| 357 | |
| 358 | function formatExecutionForLog(execution: Metric.CommandExecution): string { |
| 359 | const status = execution.success ? "PASS" : "FAIL"; |
| 360 | const exitInfo = |
| 361 | execution.exitCode !== null |
| 362 | ? `exit ${execution.exitCode}` |
| 363 | : "no exit code"; |
| 364 | const duration = `${execution.runtimeMs}ms`; |
| 365 | const error = execution.errorMessage |
| 366 | ? ` error: ${execution.errorMessage}` |
| 367 | : ""; |
| 368 | |
| 369 | return `${status} (${exitInfo}, ${duration})${error}`; |
| 370 | } |
| 371 | |
| 372 | async function cloneRepositoryAtCommit(repo: string, commitSha: string) { |
| 373 | await $`git init`.quiet(); |