Skip to content

feat: add backend unit testing foundation (Priority 1) - #7

Draft
chatlechat1994 wants to merge 1 commit into
wJubran:mainfrom
chatlechat1994:feature/priority-1-tests
Draft

feat: add backend unit testing foundation (Priority 1)#7
chatlechat1994 wants to merge 1 commit into
wJubran:mainfrom
chatlechat1994:feature/priority-1-tests

Conversation

@chatlechat1994

Copy link
Copy Markdown

This PR establishes the foundation for the project's unit testing suite, focusing on the critical initialization logic in backend/launcher.py and backend/data_server.py.

Coverage:

tests/backend/test_launcher.py: Added 5 unit tests covering appdata path resolution, configuration file generation, and error handling.

tests/backend/test_data_server.py: Added a verification test to ensure the FastAPI app object initializes correctly without triggering side effects.

Mocking & Isolation:
To ensure the test suite remains portable and runs locally without needing live broker accounts or specific system environments:

Used pytest.monkeypatch in test_launcher.py to isolate file system paths.

Used unittest.mock and sys.modules in test_data_server.py to stub out missing or system-dependent dependencies (like debug_subprocess and account_routes).

What is NOT covered yet:

Functional testing of live MT5 tick loops or WebSocket price broadcasting.

End-to-end integration testing of the authentication proxy.

Known Limitations:

Minor deprecation warnings regarding Pydantic V2 class-based config were observed but were not refactored to keep this PR scope strictly limited to testing infrastructure.

@wJubran

wJubran commented May 30, 2026

Copy link
Copy Markdown
Owner

Thanks — this draft PR is exactly the right place to continue the work.

Please feel free to keep building on this PR at your own pace without waiting for step-by-step approval from me on every small update.

As long as the scope stays within the backend testing foundation / Priority 1 direction, you can continue iterating here.

When you believe the PR is complete enough for final review, please mark it as Ready for review and I’ll review it then.

Thanks again for taking this on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants