commit | 7e89cf1838af89504df0a26abe93ebdcaa8ce337 | [log] [tgz] |
---|---|---|
author | Thomas Draebing <thomas.draebing@sap.com> | Mon Sep 23 12:22:27 2019 +0200 |
committer | Matthias Sohn <matthias.sohn@sap.com> | Mon Nov 11 17:11:44 2019 -0800 |
tree | 2b9982a1810cbdca0e1846cda1824432d5eaadd2 | |
parent | 571558f5f190da7389b9f99340f03842c776dec3 [diff] |
Format python-files with Black and Pylint The code was not following a standardized code style. This change adds the code formatter `Black` and the linting tool `Pylint` to the project as dev-dependencies. All python-files were formatted and code style issues resolved. Change-Id: I9955afbbc03e9c9571ce7c4e7122adb1f02d5199
This project provides a tool to load test Gerrit by running a set of actions typically used by Gerrit users.
The python scripts are formatted using black
[2]. The code style is further checked by pylint
[3].
To install the tools, run:
pipenv install --dev
To lint the files, run:
pipenv run black $(find . -name '*.py') && pipenv run pylint $(find . -name '*.py')
Black will automatically format all python-files. Pylint, however, will not automatically fix issues in the code. Please fix the issues pylint is showing or in reasonable cases disable the respective rules in a reasonable scope.
The tool is meant to be run in a container. To build this container, run:
docker build -t gerrit/loadtester ./container
To run an instance of the load tester. run:
docker run -it gerrit/loadtester \ --duration $TEST_DURATION \ --password $GERRIT_PWD \ --url $GERRIT_URL \ --user $GERRIT_USER
The options are:
--duration
(default: None
): Duration, for which to run the tests in seconds (optional; if not set, test runs until stopped)--password
(default: secret
): Password of Gerrit user used for executing actions--url
: URL of Gerrit (REQUIRED; e.g. https://gerrit.example.com
)--user
(default: admin
): User to be used for executing actionsThe docker containers may be used to run the load tests in Kubernetes to simulate multiple users (each instance acts as a single user). This project provides an example deployment yaml: ./load-tester.deployment.yaml
. Further, an example deployment for a logging stack based on ElasticSearch, FluentBit and Kibana to collect the logs created by the load testing scripts is provided in ./efk/
.
[1] https://github.com/pypa/pipenv [2] https://github.com/psf/black [3] https://www.pylint.org/