swactor/scripts/sim-dashboard.sh
zacheryasc 7ef7bd0b50 refactor: consolidate crates (#39)
Crates continued to grow in number, but most are still quite small and feature specific. This refactor consolidates them.
2026-02-13 17:34:01 +00:00

19 lines
670 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
DIR="$(cd "$(dirname "${1:-.}")" && pwd)/$(basename "${1:-traces}")"
PORT="${2:-8080}"
rm -rf "$DIR"
mkdir -p "$DIR"
echo "Running distribution sim tests with trace export..."
SWACTOR_TRACE_DIR="$DIR" cargo test -p simulation \
--test distribution_registry \
--test distribution_lifecycle \
--test distribution_properties || echo "WARNING: some tests failed (traces from passing tests are still available)"
COUNT=$(find "$DIR" -name '*.trace.json' 2>/dev/null | wc -l)
echo "$COUNT traces in $DIR/"
echo "Dashboard at http://localhost:$PORT"
cargo run -p simulation --features dashboard --example replay -- "$DIR" "$PORT"