aurweb/docker/scripts/run-tests.sh
Kevin Morris fa26c8078b
fix(docker): modify db configuration for new tests
A user that can create databases is now required for tests,
we use the 'root' user in Docker.

Added docker services:
---------------------
- mariadb_test - host localhost:13307

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 01:36:16 -08:00

28 lines
708 B
Bash
Executable file

#!/bin/bash
set -eou pipefail
dir=$(dirname $0)
# Clean up coverage and stuff.
make -C test clean
# Run sharness tests.
bash $dir/run-sharness.sh
# Run Python tests with MariaDB database.
# Pass --silence to avoid reporting coverage. We will do that below.
bash $dir/run-pytests.sh --no-coverage
make -C test coverage
# /cache is mounted as a volume. Copy coverage into it.
# Users can then sanitize the coverage locally in their
# aurweb root directory: ./util/fix-coverage ./cache/.coverage
rm -f /cache/.coverage
cp -v .coverage /cache/.coverage
chmod 666 /cache/.coverage
# Run flake8 and isort checks.
for dir in aurweb test migrations; do
flake8 --count $dir
isort --check-only $dir
done