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

Added ability for poetry to add and delete the test_notifications_api db during tests for #598 #913

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

anagradova
Copy link
Contributor

@anagradova anagradova commented Apr 11, 2024

Description

Installed the python library sqlalchemy-utils which contains the methods database_exists, create_database, drop_database. I modified the _notify_db method in conftest.py to allow for the method to check if the test_notifications_api db exists, if it does it will create it. After all tests run and during deconstruction, the _notify_db method will then remove the test_notifications_api database as part of it's cleanup.

This should include:

Security Considerations

NA

create and delete the test_notifications_api db
before and after the tests run.
@anagradova anagradova added engineering dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Apr 11, 2024
@anagradova anagradova requested review from ccostino and stvnrlly April 11, 2024 02:06
@anagradova anagradova self-assigned this Apr 11, 2024
@anagradova anagradova linked an issue Apr 11, 2024 that may be closed by this pull request
4 tasks
Copy link
Contributor

@ccostino ccostino left a comment

Choose a reason for hiding this comment

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

Oh awesome, thanks @anagradova! This should also help get things back on track for running tests in parallel for the API, right @stvnrlly?

I have just one small thing to try out for keeping our dependencies organized, but otherwise this should be good!

pyproject.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@xlorepdarkhelm xlorepdarkhelm left a comment

Choose a reason for hiding this comment

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

Carlo's change is all I see is needed.

pyproject.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@ccostino ccostino left a comment

Choose a reason for hiding this comment

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

Thank you, @anagradova!

@xlorepdarkhelm, you'll have to approve too now that the change is made. :-)

Copy link
Contributor

@xlorepdarkhelm xlorepdarkhelm left a comment

Choose a reason for hiding this comment

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

LGTM

@ccostino ccostino merged commit 39f1eb0 into main Apr 11, 2024
5 checks passed
@ccostino ccostino deleted the 598-re-introduce-database-creation-for-tests branch April 11, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file engineering python Pull requests that update Python code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Re-introduce database creation for tests
3 participants