Date: April 2, 2026 Current Phase: Phase 8 (Testing & Bug Fixes) Previous Log: Day 7 (Phase 7 Complete)


✅ Phase 8 Progress

Task Description Status
Android emulator setup Pixel 8 emulator running ✅ Done
Unit tests Domain model tests ✅ Done
Widget tests Login / medication add screen tests ✅ Done
Integration tests Full app flow tests ✅ Done
Local environment setup FastAPI + Supabase local integration ✅ Done
Bug fixes 6 major bugs resolved ✅ Done

1. Test Environment Setup

Android Emulator Configuration

Issue: flutter emulators --launch Pixel_8 failed due to device ID mismatch.

# Check actual running emulator ID
flutter devices
# → emulator-XXXX

# Run command
flutter run \\
  --dart-define=SUPABASE_URL=http://10.0.2.2:<SUPABASE_PORT> \\
  --dart-define=SUPABASE_ANON_KEY=<ANON_KEY> \\
  --dart-define=API_BASE_URL=http://10.0.2.2:8000/v1 \\
  -d emulator-XXXX

Android emulator → localhost connection

Inside the Android emulator, Mac's localhost is accessed via 10.0.2.2, not 127.0.0.1.

Local Environment Startup Order

1. Launch Docker Desktop
2. supabase start (in pillly-api directory)
3. supabase db reset (apply migrations)
4. uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
5. flutter run --dart-define=... -d emulator-XXXX

2. Unit Tests

Files Created

test/unit/auth/auth_repository_test.dart
test/unit/medications/medication_test.dart
test/unit/schedules/schedule_test.dart
test/unit/dose/dose_stats_test.dart
test/unit/dose/dose_log_test.dart

Key Test Cases

PilllyUser