#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/../.."
TEST_PATHS=(
scripts/dev-harness/tests
scripts/dev-harness/physical_capture_test.py
scripts/dev-harness/physical_capture_collect_test.py
scripts/dev-harness/physical_capture_fixtures/test_server.py
app/ios/test/audio_interruption_driver/test_driver.py
)
run_pytest() {
exec "$@" -m pytest "${TEST_PATHS[@]}" -q
}
for py in \
backend/.venv/bin/python \
backend/.venv/Scripts/python.exe \
backend/venv/bin/python \
backend/venv/Scripts/python.exe \
python3; do
if [ -x "$py" ] || command -v "$py" >/dev/null 2>&1; then
if "$py" -c 'import pytest, dotenv, google.auth, posthog, requests' >/dev/null 2>&1; then
run_pytest "$py"
fi
fi
done
if command -v uv >/dev/null 2>&1; then
export UV_CACHE_DIR="${UV_CACHE_DIR:-${TMPDIR:-/tmp}/omi-dev-harness-uv-cache}"
exec uv run --no-project \
--with 'pytest==8.4.1' \
--with 'python-dotenv==1.1.0' \
--with 'google-auth==2.32.0' \
--with 'posthog==3.5.2' \
--with 'requests~=2.33.0' \
python -m pytest "${TEST_PATHS[@]}" -q
fi
echo "dev-harness tests require pytest + python-dotenv + Google ADC + PostHog via a backend venv, python3, or uv; none available" >&2
exit 1