Fix socketio mocking and add MODEL_ENDPOINT env vars for tests

Fixed remaining 2 integration test failures:

1. Socketio mocking issue:
   - Tests were setting app.socketio but activity module has its own reference
   - Fixed by mocking activity.socketio directly instead of app.socketio
   - Updated test_cancel_activity_integration to check both chat_message and activity_status events
   - Updated test_display_activity_metadata_integration to use activity.socketio

2. GitHub Actions environment variables:
   - Added MODEL_ENDPOINT_0 and MODEL_API_KEY_0 to all test steps
   - These are required for app.py initialization
   - Set to dummy values (https://test.api) for testing

Test Results:
- Before: 2 failed, 39 passed
- After: 41 passed ✅

All integration tests now pass locally and should pass on GitHub Actions.
This commit is contained in:
Russell Ballestrini 2025-11-10 17:04:41 -05:00
parent aefb7005d1
commit 21acc90f2d
2 changed files with 34 additions and 10 deletions

View file

@ -37,6 +37,8 @@ jobs:
env:
SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
TESTING: "1"
MODEL_ENDPOINT_0: "https://test.api"
MODEL_API_KEY_0: "test-key"
- name: Run functional tests
run: |
@ -44,6 +46,8 @@ jobs:
env:
SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
TESTING: "1"
MODEL_ENDPOINT_0: "https://test.api"
MODEL_API_KEY_0: "test-key"
- name: Run integration tests
run: |
@ -51,6 +55,8 @@ jobs:
env:
SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
TESTING: "1"
MODEL_ENDPOINT_0: "https://test.api"
MODEL_API_KEY_0: "test-key"
- name: Validate activity YAML files
run: |