#!/bin/sh

set -e

# Ignore openstack_dashboard/dashboards/project/backups/tests.py,
# see https://bugs.debian.org/1026610 and https://github.com/python/cpython/commit/92a6abf72e7a8274f96edbb5297119d4ff055be7

PYTHON3S=$(py3versions -vr 2>/dev/null)
set -e ; set -x ; for i in ${PYTHON3S} ; do
	http_proxy=127.0.0.1:9 https_proxy=127.0.0.9:9 \
	HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 \
	PYTHON=python${i} python${i} -m coverage run -a -m pytest horizon/test/ -n $(nproc --all) -v --ds=horizon.test.settings -m "not selenium and not integration"
	PYTHON=python${i} python${i} -m coverage run -a -m pytest openstack_dashboard -v --ds=openstack_dashboard.test.settings --ignore openstack_dashboard/dashboards/project/backups/tests.py -m "not selenium and not integration"
	PYTHON=python${i} python${i} -m coverage run -a -m pytest openstack_auth/tests -n $(nproc --all) -v --ds=openstack_auth.tests.settings -m "not selenium and not integration"
done
