Skip to content
Snippets Groups Projects
Verified Commit 87f23724 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

ENH: CI for mysql: Makefile has new target `pipeline-test`

parent a750c0d3
Branches
Tags
2 merge requests!7Release v5.0.0,!4CI pipeline for mysql unit tests
Pipeline #9828 failed
...@@ -58,21 +58,19 @@ build-testenv: ...@@ -58,21 +58,19 @@ build-testenv:
######## Test ######## ######## Test ########
# Run the unit tests # Run the unit tests with MySQL
unittests: unittests-mysql:
tags: [ docker ] tags: [ docker ]
stage: test stage: test
# script: script:
# - cp config.defaults .config - make pipeline-test SQL_HOST=mysql
# - echo 'DATABASE_USER_HOST_LIST="%,"' >> .config
# - echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config
# - echo "MYSQL_HOST=mysql" >> .config
# - sleep 10
# - make install
# - ./utils/make_db restore_db tests/example.dump.sql
# - ./tests/test_utils.sh
include: "/include-test.yml"
# Run the unit tests with MariaDB
unittests-mariadb:
tags: [ docker ]
stage: test
script:
- make pipeline-test SQL_HOST=mariadb
######## Deploy ######## ######## Deploy ########
......
...@@ -24,6 +24,9 @@ SHELL=/bin/bash ...@@ -24,6 +24,9 @@ SHELL=/bin/bash
INSTALL_SQL_FILE=db_2_0.sql INSTALL_SQL_FILE=db_2_0.sql
# The hostname, used by testing in the CI pipeline
SQL_HOST ?= mysql
.PHONY: test-connection .PHONY: test-connection
test-connection: test-connection:
./utils/make_db test-connection ./utils/make_db test-connection
...@@ -74,3 +77,15 @@ test-docker-stop: ...@@ -74,3 +77,15 @@ test-docker-stop:
.PHONY: doc .PHONY: doc
doc: doc:
$(MAKE) -C doc html $(MAKE) -C doc html
# Run tests in a Gitlab pipeline
.PHONY: pipeline-test
pipeline-test:
cp config.defaults .config
echo 'DATABASE_USER_HOST_LIST="%,"' >> .config
echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config
echo "MYSQL_HOST=$(SQL_HOST)" >> .config
sleep 10
make install
./utils/make_db restore_db tests/example.dump.sql
./tests/test_utils.sh
script:
- cp config.defaults .config
- echo 'DATABASE_USER_HOST_LIST="%,"' >> .config
- echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config
- echo "MYSQL_HOST=mysql" >> .config
- sleep 10
- make install
- ./utils/make_db restore_db tests/example.dump.sql
- ./tests/test_utils.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment