Runs a post-processing shell pipeline; returns whether it succeeded.
(pipeline: string)
| 451 | |
| 452 | /** Runs a post-processing shell pipeline; returns whether it succeeded. */ |
| 453 | function runPostProcess(pipeline: string): boolean { |
| 454 | // The pipelines write their data to files themselves, so only stderr — |
| 455 | // which carries the diagnosis on failure — is captured. perf can emit |
| 456 | // megabytes of non-fatal stderr noise even on success, so the buffer is |
| 457 | // sized well above the default to not kill a healthy pipeline. |
| 458 | const result = spawnSync("bash", ["-c", pipeline], { |
| 459 | stdio: ["ignore", "ignore", "pipe"], |
| 460 | encoding: "utf-8", |
| 461 | maxBuffer: 16 * 1024 * 1024, |
| 462 | }); |
| 463 | |
| 464 | if (result.status !== 0) { |
| 465 | logWarning( |
| 466 | `post-processing failed (exit ${String(result.status)}): ${pipeline}\n` + |
| 467 | ` ${stderrTail(result.stderr)}`, |
| 468 | ); |
| 469 | return false; |
| 470 | } |
| 471 | |
| 472 | return true; |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * The last few stderr lines of a failed command, as an indented block for a |
no test coverage detected