Skip to content

Commit ada74f1

Browse files
committed
Fix integration test and improve E2E server startup
- Add missing birthdate field to CreatePatientInput in integration test - Improve backend server startup wait logic with better debugging - All 12 integration tests now passing
1 parent 1e9033d commit ada74f1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,22 @@ jobs:
269269
- name: Wait for backend
270270
run: |
271271
echo "Waiting for backend to start..."
272-
sleep 5
272+
sleep 10
273273
for i in {1..60}; do
274274
if curl -f -s http://localhost:8000/health > /dev/null 2>&1; then
275275
echo "Backend is ready!"
276276
exit 0
277277
fi
278-
echo "Attempt $i/60: Backend not ready yet..."
278+
if [ $i -le 10 ]; then
279+
echo "Attempt $i/60: Backend not ready yet..."
280+
fi
279281
sleep 2
280282
done
281283
echo "Backend failed to start after 120 seconds"
282284
echo "=== Backend Log ==="
283285
cat /tmp/backend.log || echo "No backend log found"
286+
echo "=== Checking if process is running ==="
287+
ps aux | grep uvicorn || echo "No uvicorn process found"
284288
exit 1
285289
286290
- name: Wait for frontend

backend/tests/integration/test_patient_resolver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ async def test_patient_query_patients(db_session, sample_patient):
3131
@pytest.mark.asyncio
3232
async def test_patient_mutation_create_patient(db_session, sample_location):
3333
from api.inputs import CreatePatientInput
34+
from datetime import date
3435

3536
info = MockInfo(db_session)
3637
mutation = PatientMutation()
3738
input_data = CreatePatientInput(
3839
firstname="Jane",
3940
lastname="Doe",
41+
birthdate=date(1990, 1, 1),
4042
sex=Sex.FEMALE,
4143
clinic_id=sample_location.id,
4244
)

0 commit comments

Comments
 (0)