Allow per-DB port specification for tox #1753
Closed
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.
As currently written, tox.ini allows specifying the DB port to use to connect to the test DB using a
DB_PORT
environment variable. However, it uses the same variable for the mysql, postgresql, and postgis environments. Thus if specifying a customDB_PORT
environment variable when running the full combination of tox environments, the mysql, postgresql, and postgis environments will all attempt to use the same DB port, which is unlikely to result in happiness.Fix by checking for three new environment variables,
POSTGRESQL_DB_PORT
,POSTGIS_DB_PORT
, andMYSQL_DB_PORT
in the respective environments, falling back toDB_PORT
(and then the hard-coded default) for backwards compatibility.The motivation for this change is that I wanted to run postgresql within a container listening on a non-standard port for testing, but didn't have a way to run all tox over all the environments while setting the port for postgresql/postgis without also affecting the port for mysql.
docs/changes.rst
.