Commit aba417a
committed
test: Allow passing of PostgreSQL port
Allow passing an arbitrary port via the
`SENTPY_PYTHON_TEST_POSTGRES_PORT` environmental variable.
Fedora's RPM macro `%postgresql_tests_run` which starts PostgreSQL
dynamically selects PostgreSQL port to prevent start failures when
running multiple PostgreSQL servers on the same default port [1].
This issue is not specific to Fedora. In case there is some application
running on the same machine with port `5432` opened, such as PostgreSQL
instance with the default port, this will result in failure to start the
PostgreSQL server, resulting in an inability to run these tests.
This change allows running these tests in environments where PostgreSQL
has a non-default port and where other applications (including a
PostgreSQL instance with the default port) have opened port `5432`, while
at the same time keeping the old behavior as the default.
[1] The macro is provided by
https://packages.fedoraproject.org/pkgs/postgresql15/postgresql15-test-rpm-macros/,
which packages https://github.com/devexp-db/postgresql-setup. Dynamic
selection of the port was added in 2018:
devexp-db/postgresql-setup#16, for the reasoning
see `NEWS` file changes:
https://github.com/devexp-db/postgresql-setup/pull/16/files#diff-7ee66c4f1536ac84dc5bbff1b8312e2eef24b974b3e48a5c5c2bcfdf2eb8f3ce).1 parent 855c15f commit aba417a
File tree
3 files changed
+5
-3
lines changed- tests/integrations
- asyncpg
- django
- myapp
3 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
630 | 632 | | |
631 | 633 | | |
632 | 634 | | |
| |||
0 commit comments