add a tox step (#33596)

This commit is contained in:
Benjamin Dauvergne 2019-05-31 16:52:12 +02:00
parent 9c73d72476
commit ec51dd2191
1 changed files with 7 additions and 0 deletions

7
vars/tox.groovy Normal file
View File

@ -0,0 +1,7 @@
def call() {
tmpdir = env.TMPDIR ? env.TMPDIR : '.'
sh """
virtualenv -p python3 ${tmpdir}/venv/
${tmpdir}/venv/bin/pip install tox
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 ${tmpdir}/venv/bin/tox -rv"""
}