-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtox.ini
106 lines (95 loc) · 2.69 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
[tox]
min_version = 2.3
env_list = py311
[flake8]
max-line-length = 99
exclude = .tox,wiki,.cache,.d3a,.hypothesis,.pytest_cache,vagrant,requirements,venv
[pkgenv]
pass_env =
LANG
TERM
LANGUAGE
LC_ALL
LD_LIBRARY_PATH
SOLC_BINARY
GSY_FRAMEWORK_BRANCH
OPENBLAS
[testenv]
base_python = 3.11
pass_env =
allowlist_externals =
git
/bin/rm
/bin/ln
bash
coverage
behavex
rm
ln
[testenv:setup]
pass_env = {[pkgenv]pass_env}
commands =
pip install --upgrade pip
pip install -r requirements/tests.txt
pip install -e .
pip uninstall -y gsy-framework
pip install git+https://github.com/gridsingularity/gsy-framework@{env:GSY_FRAMEWORK_BRANCH:master}
pip install --upgrade pytest py psycopg2
[testenv:unittests]
envdir = {toxworkdir}/setup
commands =
pytest -n auto ./
[testenv:coverage]
envdir = {toxworkdir}/setup
commands =
pytest --cov-report term --cov-report xml:coverage.xml --cov=src -n 8
[testenv:covclean]
envdir = {toxworkdir}/setup
skip_install = true
commands = coverage erase
[testenv:integrationtests]
envdir = {toxworkdir}/setup
pass_env =
{[pkgenv]pass_env}
INTEGRATION_TESTS_REPO
INTEGRATION_TESTS_BRANCH
commands_pre =
{[testenv:setup]commands}
git clone \
-b {env:INTEGRATION_TESTS_BRANCH:master} \
{env:INTEGRATION_TESTS_REPO:[email protected]:gridsingularity/gsy-backend-integration-tests.git} \
{envtmpdir}/gsy-backend-integration-tests
ln -sf {envtmpdir}/gsy-backend-integration-tests/gsy_e_tests/integration_tests/ ./integration_tests
commands =
behavex ./integration_tests/ --parallel-processes 4 --parallel-scheme feature -t ~@slow -t ~@disabled
commands_post =
rm ./integration_tests
[testenv:lint]
envdir = {toxworkdir}/setup
commands =
# black --check .
flake8 .
[testenv:ci]
envdir = {toxworkdir}/setup
pass_env = {[testenv:integrationtests]pass_env}
commands_pre =
{[testenv:setup]commands}
{[testenv:integrationtests]commands_pre}
commands =
{[testenv:lint]commands}
{[testenv:coverage]commands}
behavex ./integration_tests/ --exclude user_profiles.feature --parallel-processes 4 --parallel-scheme feature -t ~@slow -t ~@disabled
behave ./integration_tests/user_profiles.feature
commands_post =
{[testenv:integrationtests]commands_post}
[testenv:test_dispatch_events_top_to_bottom]
envdir = {toxworkdir}/setup
passenv = {[testenv:integrationtests]passenv}
setenv =
DISPATCH_EVENTS_BOTTOM_TO_TOP = False
commands_pre =
{[testenv:integrationtests]commands_pre}
commands =
bash -c 'for f in ./integration_tests/*.feature; do behave --tags=-disabled "$f" || exit 1; done'
commands_post =
{[testenv:integrationtests]commands_post}