๐ŸงชTesting Strategy

How we test our back end

When a PR is submitted, a series of tests will be run with Github actions. It is fine to just submit your PR and let the tests run on Github. However, if the tests fail, you may need to run the tests locally to investigate what's going on, then either fix the tests, or fix your code.

Running Python Tests Locally

To run Python tests, simply run at the top folder of the repository:

pytest -n auto

The pytest command will run both the tests written with pytest and those with the built-in python unittest.

We are aiming to migrate all unittest to pytest. Meanwhile you will see a combination of these. If you write new tests, please use pytest.

For Rapid Router and Portal, pytest also runs Selenium tests. Check the section below for what you need to install to run it.

The Python tests in Portal also include some snapshot tests. Running pytest will also automatically run the snapshot tests. When needed, the snapshot tests can be updated by running pytest --snapshot-update.

Last updated