Testing
Tests are configured to run inside a Docker container, ridding the need for tedious setup scripts. This allows for testing locally, during development, without affecting the environment.
The test directory looks like this:
Tests are grouped by functionality, and each plugin has its own test file.
Running make help
you'll see the following test commands:
When running any of the test commands locally, the tests are automatically run inside a Docker container using cedana/cedana-test:latest
or cedana/cedana-test:cuda
if including GPU tests. The CI is also configured to use these Docker images.
Each test command above runs the test file two times, in different modes:
Unique daemon & DB instance for each test.
Single persistent daemon & DB instance across a test file.
This is to allow catching bugs that may arise due to the daemon's state being persisted across tests.
Each test command is also configured to run parallel-y, configured by the PARALLELISM
variable passed to the test command. E.g. make test-regression PARALLELISM=4
will run at most 4 tests in parallel at a time.
For mode 1, parallelism offers no benefits apart from fast execution time, as each test is completely isolated. However, for mode 2, parallelism may shed light on bugs in the daemon when it's handling multiple requests concurrently.
Last updated
Was this helpful?