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

Improve test coverage for teardown with open connection #15

Open
sallner opened this issue Apr 26, 2021 · 0 comments
Open

Improve test coverage for teardown with open connection #15

sallner opened this issue Apr 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@sallner
Copy link
Collaborator

sallner commented Apr 26, 2021

In #13 drop_db has been improved for cases in which the username is not identical to the db_name that has to be dropped. The execute command broke, if there is no database named like the user.

The test should roughly do the following:

  • create a user
  • create a db for the user with a random name
  • create a connection to that database and keep it open
  • call drop_db as the newly created user (without the change done in Fix force PostgreSQL drop_db. #13 this would fail because there is no database given for the psql call, so it is trying to connect to the database of the user)

Writing this test has been non-trivial as the creation and deletion of the user might temper with the ~/.pgpass which could have long-lasting effects if not properly cleared after an error in teardown. One solution might be to move default way of testing to docker as as the settings could than be made a prerequisite.

@sallner sallner added the bug Something isn't working label Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant