debian/tests/unittest
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Tue, 15 Oct 2019 15:30:56 +0200
changeset 12734 d177d8ab4fd3
parent 12684 d464495452aa
permissions -rw-r--r--
Document mercurial configuration for contributing * how to use master/review repositories * how to send the "Available at" command in patchbomb emails * how to add the "cubicweb" flag in patchbomb emails * how to use our "jenkins" mercurial extension Closes #17243538

#!/bin/sh

set -e
set -x

### Setup tests

find cubicweb -type d -name 'test' -a '!' -wholename 'cubicweb/skeleton/*' | while read dir; do
	mkdir -p "$AUTOPKGTEST_TMP"/$(dirname "$dir")
	cp -r "$dir" "$AUTOPKGTEST_TMP/$dir"
	cp tox.ini "$AUTOPKGTEST_TMP"
done
chown -R nobody:nogroup "$AUTOPKGTEST_TMP"

### Find PostgreSQL binaries

POSTGRESQL_BINDIR=$(find /usr/lib/postgresql -type f -name 'initdb' -printf "%h\n" | head -n 1)
test "$POSTGRESQL_BINDIR" || { echo "Unable to find 'initdb'" >&2; exit 1; }

### Run tests

for py in $(py3versions -r 2>/dev/null); do
	cd "$AUTOPKGTEST_TMP"
	echo "Testing with $py:"
	su nobody --shell /bin/sh \
		-c "env PATH='$PATH:$POSTGRESQL_BINDIR' $py -m pytest -v"
done