-
Notifications
You must be signed in to change notification settings - Fork 2
Backend unit tests #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
dokterbob
wants to merge
17
commits into
main
Choose a base branch
from
backend_unit_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add test dependencies (pytest, pytest-asyncio, respx, httpx, langchain-openai) - Create tests directory with conftest.py for shared fixtures - Implement test_basic_conversation.py with 2 tests for basic chat flow - Implement test_single_tool_call.py with 2 tests for single tool invocation - Implement test_parallel_tool_calls.py with 2 tests for parallel tool calls - Mock OpenAI API using respx based on OpenAPI spec - Make get_model configurable via environment variables - Add moon backend:test task to run pytest - All tests pass with proper async handling and type checking Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
- Update imports to use new svelte_langgraph package structure - Merge test dependencies with main branch changes - Update uv.lock with merged dependencies - All tests still passing Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
- Remove langchain-openai from dev dependencies (already in runtime deps) - Extract OPENAI_TEST_BASE_URL constant to reduce duplication - Create helper functions for OpenAI mock responses (make_tool_call, make_message, make_choice, make_completion_response) - Consolidate test files into tests/svelte_langgraph/test_graph.py following 1:1 module mapping - All 6 tests pass with cleaner, more readable code Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
…revert moon.yml to direct commands Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
Co-Authored-By: Mathijs de Bruin <mathijs@mathijsfietst.nl>
Run report for eb61ad6e
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
10.4ms | Passed | |
| 🟩 | SyncProject(backend) |
0.5ms | Passed | |
| 🟩 | SetupProto(0.53.2) |
2.1s | Passed | |
| ⬛️ | SetupToolchain(python:~3.12) |
1.6s | Skipped | |
| 🟩 | InstallProjectDeps(python:~3.12, backend) |
2.8s | Passed | 2 attempts |
| 🟩 | RunTask(backend:lint) |
30.3ms | Passed | |
| 🟩 | RunTask(backend:typecheck) |
5.3s | Passed | |
| 🟩 | RunTask(backend:build) |
29.1s | Passed |
Environment
OS: Linux
Matrix:
index = 1
Touched files
apps/backend/moon.yml
apps/backend/pyproject.toml
apps/backend/src/svelte_langgraph/graph.py
apps/backend/tests/__init__.py
apps/backend/tests/conftest.py
apps/backend/tests/svelte_langgraph/test_graph.py
apps/backend/uv.lock
Run report for eb61ad6e
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
11.6ms | Passed | |
| 🟩 | SyncProject(backend) |
0.6ms | Passed | |
| 🟩 | SetupProto(0.53.2) |
1.4s | Passed | |
| ⬛️ | SetupToolchain(python:~3.12) |
1.6s | Skipped | |
| 🟩 | InstallProjectDeps(python:~3.12, backend) |
2.5s | Passed | 2 attempts |
| 🟩 | RunTask(backend:format) |
37.4ms | Passed | |
| 🟩 | RunTask(backend:lint) |
38.9ms | Passed | |
| 🟩 | RunTask(backend:typecheck) |
5.3s | Passed | |
| 🟩 | RunTask(backend:build) |
25.4s | Passed | |
| 🟩 | RunTask(backend:test) |
1m 13s | Passed |
Environment
OS: Linux
Matrix:
index = 0
Touched files
apps/backend/moon.yml
apps/backend/pyproject.toml
apps/backend/src/svelte_langgraph/graph.py
apps/backend/tests/__init__.py
apps/backend/tests/conftest.py
apps/backend/tests/svelte_langgraph/test_graph.py
apps/backend/uv.lock
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.