Odyssey testing¶
We try our best to keep Odyssey stable, and testing helps us achieve this goal. This page describes the different types of Odyssey tests and how to create them.
Unit tests¶
Tests that are written in C and checks some micro invariants all above the code. The directory is tests.
Use any currently existing test as an example to create new one.
Functional tests¶
Tests that checks some of Odyssey functionality on high level, located in docker/functional/tests. Run with pytest, to add new follow this steps:
- Create new folder in docker/functional/tests
- Create
runner.shscript inside new folder, that performs test logic (usually it starts Odyssey + performs somepsqloperations) this script must return 0 if test is passed and non-zero if test is failed. - New test will be run automaticaly with
make functional-tests - You can run specific test with
make functional-tests ODYSSEY_TEST_SELECTOR=my-cool-test - All other build type (like debug/asan/tsan) will be run automaticaly on CI or with with command like
make functional-tests ODYSSEY_TEST_SELECTOR=my-cool-test ODYSSEY_BUILD_TYPE=asan - You can debug your test inside test environment with
make start-dev-env-dbg
We will ask you to add such kind of test in PR's that implements some new options in Odyssey.
CI Github actions¶
We have several Github actions that are run on each PR. They are located in .github/workflows. and uses docker images from docker/.