Skip to content
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

Trying to solve some flakiness on integration tests #131

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ jobs:
uses: supercharge/[email protected]
with:
mongodb-version: 7.0.8
- name: Install dependencies and check code
- name: Install dependencies
run: |
poetry env use '3.10'
source .venv/bin/activate
poetry install --with docs,test
coverage run -m pytest florist/tests/integration && coverage xml && coverage report -m
- name: Run integration tests
run: |
source .venv/bin/activate
coverage run -m pytest -s -vv florist/tests/integration
coverage xml
coverage report -m
- name: Upload python coverage to Codecov
uses: Wandalen/[email protected]
with:
Expand Down
16 changes: 14 additions & 2 deletions florist/tests/integration/api/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,21 @@

async def test_train():
# Define services
server_config = uvicorn.Config("florist.api.server:app", host="localhost", port=8000, log_level="debug")
server_config = uvicorn.Config(
"florist.api.server:app",
host="localhost",
port=8000,
log_level="debug",
timeout_graceful_shutdown=120,
)
server_service = TestUvicornServer(config=server_config)
client_config = uvicorn.Config("florist.api.client:app", host="localhost", port=8001, log_level="debug")
client_config = uvicorn.Config(
"florist.api.client:app",
host="localhost",
port=8001,
log_level="debug",
timeout_graceful_shutdown=120,
)
client_service = TestUvicornServer(config=client_config)

# TODO figure out how to run fastapi with the test DB so we can use the fixture here
Expand Down