Testing#
The golden rule of testing: If it is not tested, it does not work.
Therefore, we test the QUEENS code base
to ensure our code is working as expected
to check compatibility w.r.t. to new features
to find bugs faster
Writing tests#
New tests are required if a new feature is introduced (see our contributing guidelines).
Our tests are written according to the arrange-act-assert principle.
Running tests#
QUEENS is tested using pytest. For a comprehensive list of pytest commands, see here. Some additional useful commands to test QUEENS are listed in the following:
Test |
Command |
---|---|
In parallel with pytest-xdist |
|
With verbose output |
|
With logging output |
|
With coverage report |
|
Only the last failed |
|
Pytest markers#
In QUEENS, tests are organized using pytest markers. This allows you to run all tests in a group with a single command:
Description |
Command |
---|---|
Unit tests |
|
Integration tests |
|
4C integration test (see below) |
|
List markers |
|
Integration tests with 4C#
For the integration tests in QUEENS that require the multiphysics simulation framework 4C, the user needs to create a symbolic link to the 4C-executable and store it under <queens-base-dir>/config
:
ln -s <path-to-4C-build-directory> <queens-base-dir>/config/4C_build