-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add postgres start options #351
Add postgres start options #351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the thorough approach you took here :)
Just a small requirement, to change the args to options. And rename postgres_extra_params to postgres_options maybe.
src/pytest_postgresql/plugin.py
Outdated
@@ -33,6 +33,7 @@ | |||
_help_unixsocketdir = "Location of the socket directory" | |||
_help_dbname = "Default database name" | |||
_help_load = "Load this SQL file by default, may be set multiple times" | |||
_help_postgres_start = 'Postgres executable extra parameters' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mention and indicate, that this is for the -o parameter, options. Here and in readme's table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed now
@@ -71,13 +72,13 @@ def test_rand_postgres_port(postgresql_rand): | |||
|
|||
@pytest.mark.parametrize('_', range(2)) | |||
def test_postgres_terminate_connection( | |||
postgresql, _): | |||
postgres10, _): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have been using postgres 9.x before. The backend_type
column was introduced in version 10, so here we make sure that it'll always use at least 10
@@ -60,10 +60,14 @@ def version(self): | |||
options=self.options | |||
) as connection: | |||
version = str(connection.server_version) | |||
# Pad the version for releases before 10 | |||
# if not we get 90524 instead of 090524 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the padding needed? the parse_version output can be safely compared I think? OR was there a different issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was running it locally, it would parse the version for the 9.x releases incorrectly. 90524 became 90.52 instead of 9.5
dca8fe1
to
a7502d3
Compare
d3fc410
to
29d70bd
Compare
I solved the macos build issues. It now runs tests against all supported versions of postgres on macos 10.15 Catalina (build was previously running against Travis default 10.13 High Sierra). However, the build takes a very long time because it updates homebrew. We can turn this off and just have it test against postgres 13 which would remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafmagns-skepa-dreag it open source, so we use an open source plan for this repo (I suppose that's the reason some builds finish two days after being triggered).
However, I plan to migrate it to the github actions, so if you'd have a github actions template you could use here instead travis at the very moment, feel free to migrate osx tests there, however the only fix I require would be for to fix the coverage issue in pytest configuration
pytest.ini
Outdated
@@ -0,0 +1,3 @@ | |||
[pytest] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configure these here: https://github.com/ClearcodeHQ/pytest-postgresql/blob/master/setup.cfg#L9
Just looked around as to why the coverage isn't being gathered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! I was wondering why the coverage failed. Thanks!
will be v2.6.0 as soon as it finishes building. |
Fixes #346.
Changes proposed: add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable
Additional changes: