Skip to content
Snippets Groups Projects
Unverified Commit 5d876bcd authored by Daniel's avatar Daniel
Browse files

ENH: Added MariaDB Docker option to test targets in makefile.

parent 561676e4
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`get_head_version`, `get_head_relative`, `get_version_history`.
The versions are tracked internally by the `_iversion` field which is an
integer and which should not be used outside of the backend.
* New makefile targets for testing with MariaDB instance from Docker image: call
`make test-docker` to temporarily start a Docker container with MariaDB which
will be used for the unit tests.
### Changed ###
......
......@@ -51,3 +51,21 @@ drop-%:
.PHONY: test
test:
./utils/make_db test --fresh
# Run tests with a database which is started in a Docker container
.PHONY: test-docker
test-docker:
@docker kill caosdb-mysqlserver-test || true
@docker container rm caosdb-mysqlserver-test || true
@docker run --name caosdb-mysqlserver-test -p "3306:3306" \
-e MYSQL_ROOT_PASSWORD="pass-for-test" -d mariadb
@sleep 10
MAINPATH=$(realpath tests/docker_env) utils/make_db test --fresh
@docker kill caosdb-mysqlserver-test
@docker container rm caosdb-mysqlserver-test
# if automatic stopping failed
.PHONY: test-docker-stop
test-docker-stop:
docker kill caosdb-mysqlserver-test
docker container rm caosdb-mysqlserver-test
# Config for tests with a Docker SQL server
# The host of the MySQL server.
MYSQL_HOST=127.0.0.1
# The port number of the MySQL server.
MYSQL_PORT=3306
# The user for the installation. Note: This is not the user
# which will then be used by the CaosDB Server.
MYSQL_USER=root
MYSQL_USER_PASSWORD=pass-for-test
DATABASE_USER_HOST_LIST=127.0.0.1,%,
\ No newline at end of file
../../config.defaults
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment