Files
settled-reach/tests/run-all
T
jpmschweitzerandClaude Opus 4.6 7fffdc572e test(assets): atlas determinism smoke test (#847)
Adds tests/run-atlas-determinism — imports generate_atlas as a module
and calls process_body() twice with seed=42 and dry_run=True, comparing
the returned markers dicts as JSON. No wiki files are written.

Guardrail against determinism regressions in terrain analysis, city
placement, A* road routing, infrastructure MST, and gate terminal
placement. GJ892f (domed, population 300, 1 city) is the smallest
well-exercised case.

Makefile target: make test-atlas-determinism.
Wired into tests/run-all alongside run-ipc-integration and run-visual.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 08:54:47 +02:00

81 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# tests/run-all: Run all test suites in order (D-030)
# Invokes run-rust, run-godot, run-ipc-fixtures, run-ipc-protocol,
# run-ipc-integration, run-visual, run-atlas-determinism.
# Exit: 0 = all suites pass, non-zero = any suite failed
# Stdout: {"suite":"all","total":N,"passed":N,"failed":N,"duration_ms":N,"suites":[...]}
set -euo pipefail
FILTER=""
while [[ $# -gt 0 ]]; do
case "$1" in
--filter) FILTER="${2:-}"; shift 2 ;;
--filter=*) FILTER="${1#--filter=}"; shift ;;
*) echo "Unknown argument: $1" >&2; exit 2 ;;
esac
done
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PASS_ARGS=()
[[ -n "$FILTER" ]] && PASS_ARGS+=(--filter "$FILTER")
SUITES=(
run-rust
run-godot
run-ipc-fixtures
run-ipc-protocol
run-ipc-integration
run-visual
run-atlas-determinism
)
START_MS=$(date +%s%3N)
OVERALL_TOTAL=0
OVERALL_PASSED=0
OVERALL_FAILED=0
OVERALL_EXIT=0
SUITE_RESULTS=""
for suite in "${SUITES[@]}"; do
script="$SCRIPT_DIR/$suite"
if [[ ! -x "$script" ]]; then
echo "Warning: $script not found or not executable — skipping" >&2
continue
fi
SUITE_OUT=$(mktemp)
set +e
"$script" "${PASS_ARGS[@]}" >"$SUITE_OUT"
SUITE_EXIT=$?
set -e
SUITE_JSON=$(cat "$SUITE_OUT")
rm -f "$SUITE_OUT"
# Accumulate totals from the suite's JSON output
S_TOTAL=$(echo "$SUITE_JSON" | grep -oE '"total":[0-9]+' | grep -oE '[0-9]+' || echo 0)
S_PASSED=$(echo "$SUITE_JSON" | grep -oE '"passed":[0-9]+' | grep -oE '[0-9]+' || echo 0)
S_FAILED=$(echo "$SUITE_JSON" | grep -oE '"failed":[0-9]+' | grep -oE '[0-9]+' || echo 0)
OVERALL_TOTAL=$(( OVERALL_TOTAL + ${S_TOTAL:-0} ))
OVERALL_PASSED=$(( OVERALL_PASSED + ${S_PASSED:-0} ))
OVERALL_FAILED=$(( OVERALL_FAILED + ${S_FAILED:-0} ))
[[ $SUITE_EXIT -ne 0 ]] && OVERALL_EXIT=1
# Build suites array for JSON
if [[ -n "$SUITE_RESULTS" ]]; then
SUITE_RESULTS="$SUITE_RESULTS,$SUITE_JSON"
else
SUITE_RESULTS="$SUITE_JSON"
fi
done
END_MS=$(date +%s%3N)
DURATION_MS=$((END_MS - START_MS))
printf '{"suite":"all","total":%d,"passed":%d,"failed":%d,"duration_ms":%d,"suites":[%s]}\n' \
"$OVERALL_TOTAL" "$OVERALL_PASSED" "$OVERALL_FAILED" "$DURATION_MS" "$SUITE_RESULTS"
exit $OVERALL_EXIT