feat: Add cleanup_database option to postgres fixture.#219
Open
DanCardin wants to merge 1 commit into
Open
Conversation
983cb82 to
609e488
Compare
Pull Request Test Coverage Report for Build 11132846749Details
💛 - Coveralls |
PrateekPisat
approved these changes
Sep 18, 2024
Note, this could **potentially** reveal preexisting issues in code under test, that could be perceived as a "breaking" change. By deleting the database under test at the end of the test's execution, any database connections left connected to the database might cause the `DELETE DATABASE` command to fail. PMR will **try** to use the `WITH FORCE` option on database versions >= 13.0, but that option does not exist on prior versions of postgres. In any case, if this happens, it **is** ultimately revealing a "bug" in the code it is testing. Additionally, you can simply turn off database cleanup in one of various ways.
609e488 to
574d084
Compare
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
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.
Note, this could potentially reveal preexisting issues in code under test, that could be perceived as a "breaking" change.
By deleting the database under test at the end of the test's execution, any database connections left connected to the database might cause the
DELETE DATABASEcommand to fail.PMR will try to use the
WITH FORCEoption on database versions >= 13.0, but that option does not exist on prior versions of postgres.In any case, if this happens, it is ultimately revealing a "bug" in the code it is testing. Additionally, you can simply turn off database cleanup in one of various ways.