fabro/test/docs/run_tests.sh
Bryan Helmkamp 28884ae093 rename Arc to Fabro in all Rust crates, symbols, env vars, and supporting files
- Rename 20 crate directories lib/crates/arc-* → fabro-*
- Update all Cargo.toml: crate names, dep paths, feature flags, bin name
- Rename arc_server module → fabro_server in fabro-llm
- ArcError → FabroError across 30+ files
- ARC_VERSION/ARC_GIT_SHA/ARC_BUILD_DATE → FABRO_* constants
- All use/qualified paths: arc_agent:: → fabro_agent::, etc. (~1500 occurrences)
- Env vars ARC_* → FABRO_* in string literals and shell scripts
- String literals: X-Arc-Demo, arc-bot, arc@local, arc-web, arc-mcp, etc.
- Path strings: .arc/ → .fabro/, arc.toml → fabro.toml, refs/arc/ → refs/fabro/
- arc-api.yaml → fabro-api.yaml (OpenAPI spec)
- skills/arc-create-workflow → fabro-create-workflow
- trycmd fixtures: $ arc → $ fabro
- Inline snapshots (insta) updated
- CI, Docker, install.sh, scripts, CLAUDE.md, AGENTS.md
- TypeScript app: env vars, headers, JWT issuer
- Docs: page slugs, git refs, config paths, sandbox names, repo URLs
- Repo references: brynary/arc → fabro-sh/fabro

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:25:58 -04:00

136 lines
3.7 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
ARC="${ARC:-$REPO_ROOT/target/release/fabro}"
PHASE="${1:-validate}"
VERBOSE="${VERBOSE:-0}"
PARALLEL="${PARALLEL:-1}"
# Force sequential execution when verbose to avoid interleaved output
[[ "$VERBOSE" == "1" ]] && PARALLEL=1
RESULTS_DIR="$(mktemp -d)"
trap 'rm -rf "$RESULTS_DIR"' EXIT
# Capture command output to log file; when VERBOSE=1, also stream to terminal.
capture() {
local log="$1"; shift
if [[ "$VERBOSE" == "1" ]]; then
"$@" 2>&1 | tee "$log"
else
"$@" > "$log" 2>&1
fi
}
run_one() {
local dot="$1"
local dot_dir
dot_dir="$(dirname "$dot")"
local dot_name
dot_name="$(basename "$dot")"
local rel
rel="$(python3 -c "import os; print(os.path.relpath('$dot', '$SCRIPT_DIR'))")"
# Check for companion run.toml (run-<stem>.toml in same dir)
local stem
stem="$(basename "${dot%.dot}")"
local toml
toml="${dot_dir}/run-${stem}.toml"
local result_file="$RESULTS_DIR/$(echo "$rel" | tr '/' '_')"
case "$PHASE" in
validate)
if capture "$result_file.log" "$ARC" validate "$dot"; then
if grep -qi 'warn' "$result_file.log"; then
echo "FAIL" > "$result_file"
echo " FAIL $rel (warnings)"
grep -i 'warn' "$result_file.log" | head -3 >&2
else
echo "PASS" > "$result_file"
echo " PASS $rel"
fi
else
echo "FAIL" > "$result_file"
echo " FAIL $rel"
fi
;;
preflight)
local target="$dot_name"
[[ -f "$toml" ]] && target="run-${stem}.toml"
if (cd "$dot_dir" && capture "$result_file.log" "$ARC" run start "$target" --preflight); then
echo "PASS" > "$result_file"
echo " PASS $rel"
else
echo "FAIL" > "$result_file"
echo " FAIL $rel"
grep -E "Errors:|•" "$result_file.log" | head -3 >&2
fi
;;
dry-run|haiku|full)
local target="$dot_name"
[[ -f "$toml" ]] && target="run-${stem}.toml"
local flags=(--auto-approve)
[[ "$PHASE" == "dry-run" ]] && flags+=(--dry-run)
[[ "$PHASE" == "haiku" ]] && flags+=(--model claude-haiku-4-5)
if (cd "$dot_dir" && capture "$result_file.log" "$ARC" run start "$target" "${flags[@]}"); then
echo "PASS" > "$result_file"
echo " PASS $rel"
else
echo "FAIL" > "$result_file"
echo " FAIL $rel"
tail -5 "$result_file.log" >&2
fi
;;
*)
echo "Usage: $0 <validate|preflight|dry-run|haiku|full>"
exit 1
;;
esac
}
echo "=== Phase: $PHASE (parallelism: $PARALLEL) ==="
echo ""
# Collect all dot files
dots=()
while IFS= read -r dot; do
dots+=("$dot")
done < <(find "$SCRIPT_DIR" -name '*.dot' | sort)
# Run with parallelism
active=0
for dot in "${dots[@]}"; do
run_one "$dot" &
active=$((active + 1))
if [[ $active -ge $PARALLEL ]]; then
wait -n 2>/dev/null || true
active=$((active - 1))
fi
done
wait
# Tally results
pass=0
fail=0
for f in "$RESULTS_DIR"/*; do
[[ "$f" == *.log ]] && continue
[[ ! -f "$f" ]] && continue
result="$(cat "$f")"
if [[ "$result" == "PASS" ]]; then
pass=$((pass + 1))
else
fail=$((fail + 1))
fi
done
total=$((pass + fail))
echo ""
echo "=== Results: $pass passed, $fail failed, $total total ==="
[[ $fail -eq 0 ]]