Testing¶
After you’ve set up your environment, you can run tests on available Python interpreters:
nox -rs tests
Integration tests¶
To run integration tests, the Docker daemon must be running and the Docker CLI must be available.
nox -rs integration
You can customize the following settings:
pytest option |
Environment variable |
Description |
---|---|---|
|
|
Database used for integration tests |
|
|
Docker image tag for integration tests |
|
|
Username of the LimeSurvey user to test against |
|
|
Password of the LimeSurvey user to test against |
|
|
Password of the LimeSurvey user to test against |
|
|
Reference to a specific LimeSurvey commit |
|
|
Path to the directory containing the Dockerfile |
The easiest way to set these is to create a .env
file in the root of the repository.
For example, to test against the 6.6.4-240923-apache
image with a MySQL database:
LS_DATABASE_TYPE=mysql
LS_IMAGE_TAG=6.6.4-240923-apache
Or to test against the master
branch:
LS_REF=refs/heads/master
Or to test against a specific commit (e.g. f148781ec57fd1a02e5faa26a7465d78c9ab5dfe
):
such a version in CI, add the following to the test matrix in the integration
job:
LS_REF=f148781ec57fd1a02e5faa26a7465d78c9ab5dfe
Coverage¶
I strive to maintain 100% combined coverage (from multiple Python versions, as well as integration tests), so make sure your changes are tested..
Other tests¶
Doctests¶
nox -rs xdoctest
Type checking¶
nox -rs mypy
Dependency checks¶
nox -rs deps