-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
71 lines (65 loc) · 1.58 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
68
69
70
71
[tox]
envlist =
py311
lint
mypy
pytest
shellcheck
[testenv]
skip_install=true
recreate=true
deps = -r dnas/requirements.txt
[testenv:lint]
skip_install=true
recreate=true
deps =
black
isort
changedir = {toxinidir}
commands =
black --check --diff -l 79 ./
isort --check-only --df --profile black -l 79 ./
[testenv:mypy]
skip_install=true
recreate=true
deps =
{[testenv]deps}
types-redis
types-requests
changedir = {toxinidir}
commands = mypy --config-file mypy.ini --exclude venv/ ./
[testenv:pytest]
skip_install=true
recreate=true
deps = {[testenv]deps}
passenv = *
changedir = {toxinidir}
markers =
sequential_tests
commands =
# Ensure we have the unallocated ASN data
python3 ./dnas/scripts/update_asn_allocations.py --debug
# Run as many test classes in parallel as we have cores.
# Group all tests from the same class to the same core.
pytest -vvvv -m "not mrt_stats" -x --numprocesses=logical --dist=loadfile dnas/tests/ {posargs}
# Run a single test class, this timespliting the tests
# across multiple cores.
pytest -vvvv -m "mrt_stats" -x --numprocesses=logical --dist=load dnas/tests/ {posargs}
# Cleanup test files
pytest -vvvv dnas/tests/cleanup.py {posargs}
[testenv:shellcheck]
skip_install=true
recreate=false
changedir = {toxinidir}
allowlist_externals = /bin/bash
commands = /bin/bash -c "/usr/bin/env shellcheck docker/*.sh"
[testenv:fixlint]
skip_install=true
recreate=true
deps =
black
isort
changedir = {toxinidir}
commands =
black -l 79 dnas/
isort --profile black -l 79 dnas/