Files
seaweedfs/seaweed-block/.github/scripts/known-bugs-test.sh
T
Ping QiuandClaude Opus 5.5 a5686e7fa7 Sync seaweed-block v1.1.1 into seaweed-block/ (#13411)
Brings seaweed-block main (v1.1.1 plus the docs and a test fix after it)
into seaweed-block/ as one commit. Only files under seaweed-block/ change,
and the subtree equals seaweed-block main exactly. The module's full
history stays in the seaweed-block repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:04:53 -08:00

37 lines
1.5 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
root=$(mktemp -d)
trap 'rm -rf "$root"' EXIT
mkdir -p "$root/bin"
cat >"$root/bin/go" <<'EOF'
#!/usr/bin/env bash
printf '%s\n' "$FAKE_GO_OUTPUT"
exit "$FAKE_GO_STATUS"
EOF
chmod +x "$root/bin/go"
export PATH="$root/bin:$PATH"
cd "$root"
check() {
local name=$1 status=$2 output=$3 want=$4 message=$5 actual=0
FAKE_GO_STATUS="$status" FAKE_GO_OUTPUT="$output" bash "$here/known-bugs.sh" >result 2>&1 <<'LIST' || actual=$?
#1 ./fixture TestKnown
LIST
if [ "$actual" != "$want" ] || ! grep -q "$message" result; then
echo "FAIL: $name (exit $actual, expected $want)"; cat result; exit 1
fi
if [ "$message" != 'now PASSES' ] && grep -q 'now PASSES' result; then
echo "FAIL: $name falsely called fixed"; cat result; exit 1
fi
}
check failure 1 '--- FAIL: TestKnown (0.00s)' 0 'still fails'
check pass 0 '--- PASS: TestKnown (0.00s)' 1 'now PASSES'
check missing 0 'ok fixture [no tests to run]' 1 'did not run'
check skipped 0 '--- SKIP: TestKnown (0.00s)' 1 'did not run'
check build 1 'FAIL fixture [build failed]' 1 'failed to build'
check other 1 '--- FAIL: TestKnownOther (0.00s)' 1 'did not run'
check subtest 1 ' --- FAIL: TestKnown/child (0.00s)' 1 'did not run'
check interrupted 1 '=== RUN TestKnown' 1 'did not run'
check inconsistent 0 '--- FAIL: TestKnown (0.00s)' 1 'did not run'
echo 'known-bugs: exact failure, pass, missing, skip, build, other test and interruption controls PASS'