Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.31 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.31 KB

Tests

Unit Testing

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

Load Testing

Serverless Artillery is used for load testing this service.

Installation

  1. cd tests/load
  2. Follow the Serverless Artillery installation instructions.
    1. npm install serverless
    2. npm install serverless-artillery
    3. Check that the installation succeeded: slsart --version
  3. npm install artillery-plugin-cloudwatch

Run test

  1. cd tests/load
  2. slsart invoke --stage dev #for dev

Local speed test

Locally run 500 requests in parallel. This is useful to:

  1. Verify whether the code is running asynchronously.
  2. 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()"

Profiling

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()"