Run all test cases:
python -m unittest discover tests/
Or run a specific test case:
python -m unittest tests.test_adzerk_transform.test_to_spoc
Serverless Artillery is used for load testing this service.
cd tests/load
- Follow the Serverless Artillery installation instructions.
npm install serverless
npm install serverless-artillery
- Check that the installation succeeded:
slsart --version
npm install artillery-plugin-cloudwatch
cd tests/load
slsart invoke --stage dev #for dev
Locally run 500 requests in parallel. This is useful to:
- Verify whether the code is running asynchronously.
- Do a performance test in a matter of seconds. Running a load test is still required to get an accurate result.
gunicorn -c ./tests/scripts/wsgi_profiler_conf.py "app.main:create_app()"
Measure which lines take up the most CPU time. This is useful to identify if any part of the code is taking much more time than it should.
gunicorn -c ./tests/scripts/wsgi_profiler_conf.py "app.main:create_app()"