-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
108 lines (85 loc) · 3.04 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[tox]
envlist = clean,\
# autoformats code -- because of this,
# you shouldn't use "tox" without "-e" IF you are running
# in a context where the result won't be committed. Instead you
# should use the "black_check" env which checks that the
black,\
# Run in two modes locally
local_default,local_disable_session_browser,
# Run inside docker
docker_compose,
# Ensure our executable works right
run_report_export,
# Ensure coverage and pep8
validate_coverage,flake8
# isolated_build = True is required because poetry already creates the env.
# This doesn't mean "isolate this build," it means "the build is already isolated"
isolated_build = True
# Don't install the plugin, because it's harder to track coverage
skip_install = True
[pytest]
testpaths = tests
[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
if self.\.debug
raise AssertionError
raise NotImplementedError
if __name__ == .__main_.:
[testenv]
setenv =
test_dir = {toxinidir}/tests
REPORT_DIR = {toxinidir}/webdriver-report
[testenv:bootstrap]
allowlist_externals = poetry
commands = poetry install --no-interaction --no-root
./bootstrap_chromedriver.sh
[testenv:local_default]
allowlist_externals = pytest
coverage
commands = coverage run -a --source=webdriver_recorder -m pytest -o log_cli=true -o log_cli_level=warning tests/
coverage report -m
[testenv:local_disable_session_browser]
allowlist_externals = pytest
coverage
setenv =
disable_session_browser = true
test_dir = {toxinidir}/tests
REPORT_DIR = {toxinidir}/webdriver-report
commands = coverage run -a --source=webdriver_recorder -m pytest -o log_cli=true -o log_cli_level=warning tests/
coverage report -m
[testenv:docker_compose]
allowlist_externals = docker-compose
commands = docker-compose up --build --exit-code-from test-runner
[testenv:run_report_export]
allowlist_externals = coverage
commands = coverage run -a --source=webdriver_recorder \
-m webdriver_recorder.export-report \
-i {env:REPORT_DIR}/report.json
[testenv:validate_coverage]
allowlist_externals = coverage
commands = coverage html
coverage report --fail-under 100 -m
[testenv:clean]
allowlist_externals = coverage
rm
commands = coverage erase
rm -fv {env:REPORT_DIR}/worker.*
[testenv:flake8]
allowlist_externals = flake8
commands = flake8 {toxinidir}/webdriver_recorder
[testenv:black]
allowlist_externals = black
commands = black {toxinidir}/webdriver_recorder {toxinidir}/tests --line-length 119
[testenv:black_check]
allowlist_externals = black
commands = black {toxinidir}/webdriver_recorder {toxinidir}/tests --line-length 119 --check
[testenv:dump_strict_envs]
allowlist_externals = tox
sed
paste
commands: tox -l | sed '/^\\$/d' | sed 's|black|black_check|g' | paste -sd "," -
[flake8]
max-line-length = 119