debian/tests/unittest
author Jérémy Bobbio <jeremy.bobbio@irq7.fr>
Mon, 10 Jun 2019 11:13:06 +0200
changeset 12647 cb596dca133f
parent 12643 c0ff60cd4c1f
child 12683 d77afae12d45
permissions -rw-r--r--
[pkg] Stop using /etc/bash_completion.d cubicweb-ctl shipped an empty /etc/bash_completion.d as a leftover of shipping a bash completion script. As pointed by Lintian, this directory is not obsolete, so let's get rid of it for good.

#!/bin/sh

set -e
set -x

### Setup tests

find cubicweb -type d -name 'test' | while read dir; do
	mkdir -p "$AUTOPKGTEST_TMP"/$(dirname "$dir")
	cp -r "$dir" "$AUTOPKGTEST_TMP/$dir"
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