From f3efc18b508d505f242426911ce22231dc182e05 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Sat, 27 Nov 2021 22:42:12 -0800 Subject: [PATCH] feat(docker): force test db configuration Signed-off-by: Kevin Morris --- docker/test-mysql-entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker/test-mysql-entrypoint.sh b/docker/test-mysql-entrypoint.sh index a46b2572..262577a6 100755 --- a/docker/test-mysql-entrypoint.sh +++ b/docker/test-mysql-entrypoint.sh @@ -5,4 +5,16 @@ set -eou pipefail cp -vf conf/config.dev conf/config sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config +# We use the root user for testing in Docker. +# The test user must be able to create databases and drop them. +aurweb-config set database user 'root' +aurweb-config set database host 'localhost' +aurweb-config set database socket '/var/run/mysqld/mysqld.sock' + +# Remove possibly problematic configuration options. +# We depend on the database socket within Docker and +# being run as the root user. +aurweb-config unset database password +aurweb-config unset database port + exec "$@"