Example of integration and functional tests with pytest framework, because most of the internet filled up with unit tests
Absolute minimum of course is pytest
python package.
You can fill up all you need by requirements.txt (see Dockerfile
) or
use raw pip install in your own Dockerfile (see Dockerfile-raw
).
I hope you plan to use this repo as upstream in your own CI, so look at the example inside docker-compose.yml to build Integration Tests stage in pipeline:
- Run tests:
docker-compose up -d -p integration_tests_${CI_COMMIT_SHORT_SHA}
- Wait until tests done:
while ! test -f report.html ; do sleep 10; done
- Cleanup:
docker-compose down -p integration_tests_${CI_COMMIT_SHORT_SHA}