29 lines
1.0 KiB
Bash
29 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
TMP_DIR="$(mktemp -d)"
|
|
trap 'rm -rf "$TMP_DIR"' EXIT
|
|
|
|
BAD_FILE="$TMP_DIR/bad-status.txt"
|
|
cat > "$BAD_FILE" <<'EOF'
|
|
window_size=7 success_count=6 failure_count=1 success_rate=85.71 threshold=95 precondition_missing=0 external_provider_failure=1 collector_runtime_failure=0 unknown_failure=0
|
|
EOF
|
|
|
|
set +e
|
|
bash scripts/review/stability_status_guard.sh "$BAD_FILE" >/tmp/stability_bad.out 2>&1
|
|
BAD_RC=$?
|
|
set -e
|
|
[[ "$BAD_RC" -ne 0 ]]
|
|
grep -q 'missing stability label' /tmp/stability_bad.out
|
|
|
|
GOOD_FILE="$TMP_DIR/good-status.txt"
|
|
cat > "$GOOD_FILE" <<'EOF'
|
|
window_size=7 success_count=6 failure_count=1 success_rate=85.71 threshold=95 precondition_missing=0 external_provider_failure=1 collector_runtime_failure=0 unknown_failure=0 stability_label=recovered-external-incident
|
|
EOF
|
|
|
|
bash scripts/review/stability_status_guard.sh "$GOOD_FILE" >/tmp/stability_good.out 2>&1
|
|
grep -q 'STABILITY_STATUS_GUARD: PASS' /tmp/stability_good.out
|