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

tests: update env.py and conftest so tests use unique databases #3654

Merged
merged 36 commits into from
Oct 10, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request includes refactoring of the Alembic environment script to simplify the database connection logic and remove unused imports. It also refactors the test client fixture to use TemporaryDirectory and UUID for the database path. These changes improve the code readability and maintainability.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 2, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3654.dmtpw4p5recq1.amplifyapp.com

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 3, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 3, 2024
- Added cleanup steps to various pytest fixtures to ensure temporary directories, database entries, and other resources are properly cleaned up after tests.
- Modified fixtures to use `yield` for better resource management.
- Ensured database connections are closed and tables are dropped after tests.
- Improved temporary directory handling with context managers.
… and fixtures, and update existing fixtures for consistency.
- Corrected the import order in `utils.py`.
- Added validation for `flow_id` in the transaction handling logic to ensure it is set correctly.
- Introduced `_delete_transactions_and_vertex_builds` function to remove transactions and vertex builds associated with a user.
- Updated `user` fixture to call the new cleanup function before deleting the user.
@ogabrielluiz ogabrielluiz marked this pull request as ready for review October 8, 2024 11:31
@ogabrielluiz ogabrielluiz removed the request for review from nicoloboschi October 8, 2024 11:32
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) October 9, 2024 13:01
@ogabrielluiz ogabrielluiz added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

Cannot auto-update because of conflicts.

@ogabrielluiz ogabrielluiz added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Oct 9, 2024
@ogabrielluiz ogabrielluiz added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Oct 9, 2024
@ogabrielluiz ogabrielluiz added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Oct 10, 2024
@ogabrielluiz ogabrielluiz merged commit 2adda78 into main Oct 10, 2024
27 checks passed
@ogabrielluiz ogabrielluiz deleted the fix/migrationenvpy branch October 10, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants