Home

Awesome

License: MPL 2.0 TravisCI Build Status codecov CII Best Practices

GENIVI SOTA Project

This project is the top-level git repository for the GENIVI SOTA project.

Please refer to the documentation for more information.

Running tests

Setup

To run tests, we need a mariadb instance running. We also need a user with CREATE DATABASE privileges. All tests run in parallel, so we need to increase maximum allowed connections with:

set global max_connections = 1000;

The database also needs to be started with a default encoding and collation. This corresponds to the --character-set-server=utf8 --collation-server=utf8_unicode_ci, --max_connections=1000 flags.

This can be done with the following:

mkdir entrypoint.d/

echo "
CREATE DATABASE sota_resolver;
CREATE DATABASE sota_resolver_test;
CREATE DATABASE sota_core;
CREATE DATABASE sota_core_test;
CREATE DATABASE sota_device_registry;
CREATE DATABASE sota_device_registry_test;
GRANT ALL PRIVILEGES ON \`sota\_core%\`.* TO 'sota_test'@'%';
GRANT ALL PRIVILEGES ON \`sota\_resolver%\`.* TO 'sota_test'@'%';
GRANT ALL PRIVILEGES ON \`sota\_device\_registry%\`.* TO 'sota_test'@'%';
FLUSH PRIVILEGES;
" > entrypoint.d/db_user.sql

docker run -d \
  --name mariadb-sota \
  -p 3306:3306 \
  -v $(pwd)/entrypoint.d:/docker-entrypoint-initdb.d \
  -e MYSQL_ROOT_PASSWORD=sota-test \
  -e MYSQL_USER=sota_test \
  -e MYSQL_PASSWORD=s0ta \
  mariadb:10.1 \
  --character-set-server=utf8 --collation-server=utf8_unicode_ci \
  --max_connections=1000

After being created, the database can be started and stopped with docker start/stop mariadb-sota

Running

There are multiple test tasks that can be executed: