Development#

Install for Development#

First off, thanks for taking the time to contribute!

This small guideline may help taking the first steps.

Happy hacking :)

Fork the Repository#

Clone stressor to a local folder and checkout the branch you want to work on:

$ git clone git@github.com:mar10/stressor.git
$ cd stressor
$ git checkout my_branch

Work in a Virtual Environment#

Install Python#

We need Python 3.7+, and pipenv on our system.

If you want to run tests on all supported platforms, install Python 3.7, 3.8, 3.9, 3.10, and 3.11.

Create and Activate the Virtual Environment#

Install dependencies for debugging:

$ cd /path/to/stressor
$ pipenv shell
(stressor) $ pipenv install --dev
(stressor) $

The development requirements already contain the stressor source folder, so pipenv install -e . is not required.

The code should now run:

$ stressor --version
2.0.0

The test suite should run as well:

$ tox

Build Sphinx documentation to target: <stressor>/docs/sphinx-build/index.html)

$ tox -e docs

Run Tests#

Run all tests with coverage report. Results are written to <stressor>/htmlcov/index.html:

$ tox

Run selective tests:

$ tox -e py311
$ tox -e py311 -- -k test_context_manager

Run Demo Stress Test#

First, install stressor for debugging in a virtual environment as described above. Now start a test webserver from the console:

$ cd /path/to/stressor
$ pipenv shell
$ wsgidav

Open a second shell and run the stress test:

$ cd /path/to/stressor
$ pipenv shell
$ stressor run tests/fixtures/test_mock_server.yaml --monitor

Code#

The tests also check for eslint, flake8, black, and isort standards.

Format code using the editor’s formatting options or like so:

$ tox -e format

Note

Follow the Style Guide, basically PEP 8.

Failing tests or not follwing PEP 8 will break builds on travis, so run $ tox and $ tox -e format frequently and before you commit!

Create a Pull Request#

Todo

TODO