Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

System Tests

Alexander Dubrawski edited this page Nov 16, 2020 · 4 revisions

Backend

There are two kinds of environments in which the system tests for the backend can be executed. One runs the system tests on the backend running in docker and the other one on the backend running natively. The system tests executed in both environments is the same. Just the start-up phase and the teardown phase is different.

Docker enviroment

The system test for the docker environment is starting the following containers:

  • backend
  • influxdb
  • hyrise_1

In every run, it will build the backend completely new. It will use the environment variables defined in docker.ini. Every component is running on the same machine.

Run system test

To execute the system tests run the following commands:

  • Navigate to the system tests: cd system_tests
  • Execute the system tests: pytest --capture=sys -c docker.ini test_docker_backend.py

With the --capture=sys flag we can see the output of docker-compose and as a result of that the building process of the containers.

Log files

The system test is creating log files from the output of the containers. There are the following files:

  • backend_docker_log.txt
  • influxdb_docker_log.txt
  • hyrise_1_docker_log.txt

Native environment

The system test for the native environment is only starting the backend. So you need to take care of it to have a Hyrise instance running and an influx. Please make sure the Hyrise is set up accordingly (https://github.com/hyrise/Cockpit/wiki/Hyrise-Things).

Run system tests

First navigate to the system tests: cd system_tests.

If your Hyrise instance is running on you local machine and port 5432 you can just run:

pytest -c native.ini test_native_backend.py

If your Hyrise instance is running on machine 123.123.123.123 and port 4444 you need to set the environment variables manually. For that you can run:

DATABASE_HOST=123.123.123.123 DATABASE_PORT=4444 pytest -c native.ini test_native_backend.py

Log files

The system test is creating log files from the output of the backend. There are the following files:

  • cockpit_stderr.txt
  • cockpit_stdout.txt

Frontend

For the frontend end, 2 end tests exist. In these tests, the backend is mocked. To execute the tests navigate to the frontend code cd hyrisecockpit/frontend. Make sure all npm packages are installed (npm install). You can run all tests with npm run test:e2e. To disable UI and execute all tests in headless mode, run: npm run test:e2e:headless.