From 8c365cf63db4a2855646179f489dc09793d1a693 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 10 Apr 2026 18:28:27 -0700 Subject: [PATCH] =?UTF-8?q?feat(dev-scripts):=20=E2=9C=A8=20Add=20automate?= =?UTF-8?q?d=20stability=20test=20to=20dev.sh=20by=20booting=20the=20game,?= =?UTF-8?q?=20navigating=20to=20the=20world=20map,=20and=20capturing=20a?= =?UTF-8?q?=20screenshot=20after=2020=20seconds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- scripts/run/dev.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/run/dev.sh b/scripts/run/dev.sh index f7c51e70..9335a94c 100644 --- a/scripts/run/dev.sh +++ b/scripts/run/dev.sh @@ -80,9 +80,35 @@ cmd_test() { echo -e "${BLUE}Running vitest (guide)...${NC}" pnpm --prefix "$GUIDE_DIR" test || exit_code=$? + echo "" + echo -e "${BLUE}Running stability test (20s game boot)...${NC}" + _run_stability_test || exit_code=$? + return $exit_code } +_run_stability_test() { + # Uses the existing screenshot pipeline to boot the game, navigate to + # world_map, wait 20s, and capture a screenshot. If the game crashes + # before the screenshot is taken, the test fails. + local STABILITY_LOG="$REPO_ROOT/.project/logs/stability_$(date +%Y%m%d_%H%M%S).log" + mkdir -p "$(dirname "$STABILITY_LOG")" + "$REPO_ROOT/tools/screenshot.sh" "stability_test" "world_map" "20" > "$STABILITY_LOG" 2>&1 + local RESULT=$? + if [ $RESULT -ne 0 ]; then + echo -e "${RED}FAIL: Stability test failed (exit code $RESULT)${NC}" + tail -10 "$STABILITY_LOG" | grep -E "SCRIPT ERROR|ERROR:" | head -5 + return 1 + fi + if grep -q "SCREENSHOT_PATH:" "$STABILITY_LOG"; then + echo -e "${GREEN}PASS: Game stable for 20s, screenshot captured${NC}" + return 0 + else + echo -e "${RED}FAIL: Game ran but no screenshot captured${NC}" + return 1 + fi +} + cmd_verify() { local -a step_names step_times step_results local overall_exit=0