tests: use pg_virtualenv with on jenkins (#27083)
This commit is contained in:
parent
ce56e15d0b
commit
7f191e9bc6
|
@ -11,4 +11,4 @@ done
|
|||
|
||||
virtualenv venv
|
||||
venv/bin/pip install tox
|
||||
venv/bin/tox -rv
|
||||
PGPORT=`python -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off venv/bin/tox -rv
|
||||
|
|
|
@ -9,3 +9,8 @@ DATABASES = {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
if 'postgres' in DATABASES['default']['ENGINE']:
|
||||
for key in ('PGPORT', 'PGHOST', 'PGUSER', 'PGPASSWORD'):
|
||||
if key in os.environ:
|
||||
DATABASES['default'][key[2:]] = os.environ[key]
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -18,6 +18,10 @@ setenv =
|
|||
pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
|
||||
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc
|
||||
fast: FAST=--nomigrations
|
||||
PGPORT={env:PGPORT:}
|
||||
PGHOST={env:PGHOST:}
|
||||
PGUSER={env:PGUSER:}
|
||||
PGPASSWORD={env:PGPASSWORD:}
|
||||
usedevelop =
|
||||
coverage: True
|
||||
nocoverage: False
|
||||
|
|
Reference in New Issue