-
Notifications
You must be signed in to change notification settings - Fork 142
/
tox.ini
67 lines (64 loc) · 2.45 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[tox]
envlist =
lint
py{38,39,310,311,312}
no_extras
[testenv]
passenv = DOCKER_*
; The above line is mostly for minikube support, and in that case you'll also need to forward the port, like this:
; ssh -i $(minikube ssh-key) docker@$(minikube ip) -L 5432:127.0.0.1:5432
setenv =
PGPASSWORD=password
PGUSER=postgres
deps =
pytest
extras =
all
allowlist_externals =
bash
timeout
grep
sleep
curl
commands =
pytest test/test_all.py
# ensure final samples from worker get sent to master when using iteration limit
bash -ec "export LOCUST_LOCUSTFILE=examples/reschedule_on_fail_ex.py && (locust --master --headless -i 8 --expect-workers 2 -u 4 2> output.txt & locust --worker & locust --worker & wait && grep '16(100.00%)' output.txt)"
python3 -m playwright install
bash -ec "(cd examples && PYTHONUNBUFFERED=1 locust -f playwright_ex.py --headless -t 10 -u 3) |& tee output.txt || true"
grep -m 1 'playwright-recording.py' output.txt
grep -m 1 'google' output.txt
grep -m 1 'Manual' output.txt
grep -m 1 'LCP' output.txt
bash -ec "! grep 'object has no attribute' output.txt"
bash -ec "(cd examples && PYTHONUNBUFFERED=1 locust -f distributor_ex.py --headless -t 5 -u 4 --processes 4) |& tee output.txt || true"
grep -m 1 'customer=2099010101-1111' output.txt
grep -m 1 'product=asdf1' output.txt
bash -ec "! grep -q Traceback output.txt"
locust -f examples/jmeter_listener_example.py --headless -t 1
locust-compose up -d
sleep 15
bash -ec "locust -f examples/rest_ex.py --timescale --headless -t 2 -s 60 --exit-code-on-error 0 |& tee output.txt || true"
grep -m 1 "Report: http://localhost:3000/d/qjIIww4Zz?&var-testplan=examples/rest_ex.py&from=" output.txt
bash -ec "! grep -q Traceback output.txt"
# check that there is at least one logging from today
bash -ec "docker exec dashboards-postgres-1 psql -U postgres -qtAc 'select id from testrun' | grep $(date +'%y-%m-%d')"
; check that main dashboard exists
curl --fail 'http://localhost:3000/api/dashboards/uid/qjIIww4Zz'
; run this if you want to ensure a clean slate
; locust-compose down -v
[testenv:lint]
deps =
black==23.1.0
pylint
commands =
pylint --rcfile .pylintrc locust_plugins/
bash -ec "pylint --rcfile .pylintrc examples/*.py"
black --check locust_plugins/
[testenv:no_extras]
deps =
pylint
pytest
extras = []
commands =
pytest test/test_missing_extras.py