#!/usr/bin/env bash # Full test suite: app-level (Streamlit AppTest) + real-browser e2e (Playwright). # # Usage: ./run_tests.sh # The browser e2e part needs the server running (./run.sh, port 8599); # it is skipped automatically if the server is down. set -uo pipefail cd "$(dirname "$0")" fail=0 echo "=== 1/4 data cache tests (incremental refresh) ===" .venv/bin/python tests/test_data.py || fail=1 echo echo "=== 2/4 after-tax model tests (synthetic) ===" .venv/bin/python tests/test_tax.py || fail=1 echo echo "=== 3/4 app tests (AppTest, no browser) ===" .venv/bin/python tests/test_app.py || fail=1 echo echo "=== 4/4 browser e2e (Playwright, needs the server) ===" if curl -s -m 3 -o /dev/null http://localhost:8599/healthz; then .venv/bin/python tests/test_e2e_browser.py || fail=1 else echo "server not reachable on :8599 — skipping e2e (start it with ./run.sh)" fi echo [ $fail -eq 0 ] && echo "ALL TESTS PASSED" || echo "TESTS FAILED" exit $fail