Files
swift-nio/scripts
Rick Newton-Rogers 83b0fcd82d Benchmark diffs not being output on threshold regression (#3515)
### Motivation

* `check_benchmark_thresholds.sh` was updated to check for exit code 2
from `swift package benchmark thresholds check` to distinguish threshold
regression from build errors.
* It seems SwiftPM's `CommandPlugin` infrastructure always exits with
code 1 when `performCommand` throws, regardless of the error's raw
value. So the exit code is never 2, causing all regressions to fall
through to the `else` branch and be misreported as build errors, with no
diff output.

### Modifications

* Remove the `rc == 2` check and instead attempt `thresholds update` for
any non-zero `rc` from `thresholds check`.
* Use the result of `thresholds update` to distinguish regression
(success) from build error (failure).
* Remove `--exit-code` from `git diff` to prevent `set -uo pipefail`
from aborting the script before output is fully flushed.

### Result

* Benchmark threshold regressions correctly output the `=== BEGIN DIFF
===` section again.
* Actual build errors are still correctly detected and reported.
2026-02-20 15:54:04 +00:00
..