From 2689f9e29e3efff4054e5736113623b725bf7cd9 Mon Sep 17 00:00:00 2001 From: AI Agent Date: Thu, 19 Mar 2026 17:01:31 -0600 Subject: [PATCH] Add tests for weather and time of day system --- .gitea/workflows/smoke-tests.yml | 29 +++++++++++++++++++++++++++++ TESTING.md | 7 +++++++ run-tests.sh | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/.gitea/workflows/smoke-tests.yml b/.gitea/workflows/smoke-tests.yml index e048653..02a1676 100644 --- a/.gitea/workflows/smoke-tests.yml +++ b/.gitea/workflows/smoke-tests.yml @@ -61,6 +61,35 @@ jobs: set -e [[ $r -eq 0 || $r -eq 255 ]] + - name: Smoke - weather and time + run: | + set -euo pipefail + RUST_LOG=info ./target/debug/mudserver -d "$TEST_DB" & + MUD_PID=$! + trap 'kill $MUD_PID 2>/dev/null || true' EXIT + bash scripts/ci/wait-for-tcp.sh 127.0.0.1 2222 + set +e + ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 smoketest@localhost <<'EOF' > weather_test.out + go south + go down + look + quit + EOF + r=$? + set -e + [[ $r -eq 0 || $r -eq 255 ]] + if ! grep -q "The sky is\|raining\|storm\|snow\|fog" weather_test.out; then + echo "Error: Weather info not found in look output" + cat weather_test.out + exit 1 + fi + if ! grep -q "\[Night\]\|\[Morning\]\|\[Afternoon\]\|\[Evening\]" weather_test.out; then + echo "Error: Time of day info not found in look output" + cat weather_test.out + exit 1 + fi + rm weather_test.out + - name: Smoke - persistence (reconnect) run: | set -euo pipefail diff --git a/TESTING.md b/TESTING.md index 643117b..167e7e3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -113,6 +113,13 @@ Run through the checks below before every commit to ensure consistent feature co - [ ] Negative status effects cleared on player death/respawn - [ ] Status effects on offline players resolve by wall-clock time on next login +## Weather & Time +- [ ] Outdoor rooms display time of day (e.g., `[Night]`, `[Morning]`). +- [ ] Outdoor rooms display current weather (e.g., `The sky is clear`, `It is raining`). +- [ ] Indoor rooms do not show weather or time of day. +- [ ] Rain or storm applies the `wet` status effect to players in outdoor rooms. +- [ ] Weather changes periodically and broadcasts messages to players in outdoor rooms. + ## Guilds - [ ] `guild list` shows all available guilds with descriptions - [ ] `guild info ` shows guild details, growth stats, and spell list diff --git a/run-tests.sh b/run-tests.sh index 0832e86..d26d0a1 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -44,6 +44,25 @@ flee quit EOF +ssh_mud smoketest@localhost <<'EOF' > weather_test.out +go south +go down +look +quit +EOF + +if ! grep -q "The sky is\|raining\|storm\|snow\|fog" weather_test.out; then + echo "Error: Weather info not found in look output" + cat weather_test.out + exit 1 +fi +if ! grep -q "\[Night\]\|\[Morning\]\|\[Afternoon\]\|\[Evening\]" weather_test.out; then + echo "Error: Time of day info not found in look output" + cat weather_test.out + exit 1 +fi +rm weather_test.out + ssh_mud smoketest@localhost <<'EOF' look stats