From a37e407483b5b65967d72cc523a20133cf89d3ab Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Wed, 22 Jun 2022 11:32:40 +0000 Subject: [PATCH] chore: create test database on mariadb init + harmonize test database credentials --- .gitlab-ci.yml | 6 +++--- docker-compose.yml | 1 + initdb/01.sql | 2 ++ phpunit.xml.dist | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 initdb/01.sql diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 578045a9..93c274a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,10 +68,10 @@ tests: services: - mariadb variables: - MYSQL_DATABASE: "tests" MYSQL_ROOT_PASSWORD: "R00Tp4ssW0RD" - MYSQL_USER: "tests_user" - MYSQL_PASSWORD: "password" + MYSQL_DATABASE: "test" + MYSQL_USER: "castopod" + MYSQL_PASSWORD: "castopod" script: - apt-get install -y mariadb-client libmariadb-dev diff --git a/docker-compose.yml b/docker-compose.yml index 156539b2..667b511e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,7 @@ services: ports: - 3306:3306 volumes: + - ./initdb:/docker-entrypoint-initdb.d - mariadb:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root diff --git a/initdb/01.sql b/initdb/01.sql new file mode 100644 index 00000000..2429cc61 --- /dev/null +++ b/initdb/01.sql @@ -0,0 +1,2 @@ +CREATE DATABASE IF NOT EXISTS `test`; +GRANT ALL ON `test`.* TO 'castopod'@'%'; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c6b5aa99..7395ebae 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -46,9 +46,9 @@ - - - + + +