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>
This commit is contained in:
Kevin Morris 2021-11-17 00:44:35 -08:00
parent fa43f6bc3e
commit fa26c8078b
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
12 changed files with 53 additions and 79 deletions

View file

@ -1,7 +1,4 @@
#!/bin/bash
set -eou pipefail
# Initialize the new database; ignore errors.
python -m aurweb.initdb 2>/dev/null || /bin/true
exec php-fpm --fpm-config /etc/php/php-fpm.conf --nodaemonize

View file

@ -25,17 +25,8 @@ done
rm -rf $PROMETHEUS_MULTIPROC_DIR
mkdir -p $PROMETHEUS_MULTIPROC_DIR
# Initialize the new database; ignore errors.
python -m aurweb.initdb 2>/dev/null || \
(echo "Error: aurweb.initdb failed; already initialized?" && /bin/true)
# Run test_initdb ahead of time, which clears out the database,
# in case of previous failures which stopped the test suite before
# finishing the ends of some test fixtures.
eatmydata -- pytest test/test_initdb.py
# Run pytest with optional targets in front of it.
eatmydata -- make -C test "${PARAMS[@]}" pytest
pytest
# By default, report coverage and move it into cache.
if [ $COVERAGE -eq 1 ]; then

View file

@ -12,12 +12,6 @@ bash $dir/run-sharness.sh
# Pass --silence to avoid reporting coverage. We will do that below.
bash $dir/run-pytests.sh --no-coverage
# Export SQLite aurweb configuration.
export AUR_CONFIG=conf/config.sqlite
# Run Python tests.
bash $dir/run-pytests.sh --no-coverage
make -C test coverage
# /cache is mounted as a volume. Copy coverage into it.