21 tests across 6 groups: A. Config loading & persistence (runtime path, YAML schema, overrides) B. Runtime state (live globals reading, /config/set sync, restore) C. Reset (full reset, single-key reset) D. Server manager (zero-server default, corrupt handling, CRUD, no dead code) E. GPU deduplication (delegates to config_manager, correct URL switching) F. Clean imports (no dead os/Union/GUILD_SETTINGS) Run: ./bot/tests/run_tests.sh (builds + runs in Docker container)
26 lines
668 B
Bash
Executable File
26 lines
668 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run the config/state regression tests inside the miku-bot Docker container.
|
|
#
|
|
# Usage:
|
|
# ./bot/tests/run_tests.sh # build + run
|
|
# ./bot/tests/run_tests.sh --no-build # skip rebuild
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/../.." # repo root
|
|
|
|
if [[ "${1:-}" != "--no-build" ]]; then
|
|
echo "Building miku-bot image..."
|
|
docker compose build miku-bot
|
|
fi
|
|
|
|
echo ""
|
|
echo "Running config/state regression tests..."
|
|
echo ""
|
|
|
|
docker run --rm \
|
|
-v "$(pwd)/config.yaml:/config.yaml:ro" \
|
|
-v "$(pwd)/bot/tests:/app/tests:ro" \
|
|
-e DISCORD_BOT_TOKEN=test_token \
|
|
miku-discord-miku-bot \
|
|
python tests/test_config_state.py
|