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

[Enhancement]: Resolve Failing Backend Tests #1838

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Jul 3, 2024

Description

This PR addresses the issue of failing backend tests due to improper database (sqlalchemy async engine) initialization. The changes ensure that the database is correctly set up before tests run, preventing the failures.

Changes Made

  • Move initialization of async SQLAlchemy engine to the init method: Ensures that the engine is properly configured when the class is instantiated.
  • Instantiate DBEngine class to a variable instance: Provides a consistent and reusable database engine instance across the lifecycle of the tests session.

Context

The backend tests were failing because the async engine was not properly initialized. By moving the initialization of the SQLAlchemy engine to the __init__ method and ensuring the DBEngine class is properly instantiated, we ensure that the database connection is correctly established.

Testing

  • Ran all backend tests locally to verify that the issue is resolved.
  • Confirmed that the tests pass without any failures.
  • Checked that the changes do not introduce any new issues.

Copy link

vercel bot commented Jul 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 6:10am

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 3, 2024
@dosubot dosubot bot added Backend bug Something isn't working labels Jul 3, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 3, 2024
@aybruhm aybruhm requested review from mmabrouk and aakrem and removed request for mmabrouk July 3, 2024 06:13
Copy link
Collaborator

@aakrem aakrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @aybruhm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 3, 2024
@aakrem aakrem merged commit 2e3ee66 into postgres-migration Jul 3, 2024
6 checks passed
@aakrem aakrem deleted the resolve-failing-backend-tests branch July 3, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants