-
Notifications
You must be signed in to change notification settings - Fork 3
System Tests
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.
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.
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.
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
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).
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
The system test is creating log files from the output of the backend. There are the following files:
- cockpit_stderr.txt
- cockpit_stdout.txt
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
.