Tests for the Kinto server fall into 3 categories:
- unit tests - located here: https://github.com/Kinto/kinto/tree/master/tests
- loadtests - located here: https://github.com/Kinto/kinto-loadtests
- configuration check tests - located in this repo
This repo is a clearinghouse for all automated tests that don't need to reside in their own repository. They would include a variety of test types that usually fall in the middle of the test pyramid: API tests, config and URL checks, deployment tests, end-2-end tests, security tests, etc.
To run the tests, you need to have the following installed:
- Python 3.6 or greater
- Pipenv
You can run these tests using the following commands from inside the root directory for the project:
$ pipenv install
$ pipenv run pytest -m TEST_TYPE --env TEST_ENV
TEST_TYPE
isdist
forkinto-dist
deployments,settings
forkinto-settings
deployments andwebextensions
forkintowe
deploymentsTEST_ENV
is one of the environments listed in themanifest.ini
file.
With Docker installed, running the tests is as simple as first building:
$ docker build -t kinto-tests .
Then, you can run the tests like so (substituting your TEST_TYPE and TEST_ENV):
$ docker run -it kinto-tests pytest -m TEST_TYPE --env=TEST_ENV