-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtox.ini
More file actions
165 lines (152 loc) · 5.85 KB
/
tox.ini
File metadata and controls
165 lines (152 loc) · 5.85 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
; Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
; SPDX-License-Identifier: Apache-2.0
[tox]
minversion = 4.0.13
env_list =
lint
type
tests
coverage
[testenv:lint]
description = run lint checks
skip_install = true
deps =
-rrequirements/lint.txt
commands =
black --check .
isort --check source
pytest source/tests/header.py
[testenv:type]
description = run type checks
package = wheel
wheel_build_env = .pkg
deps =
-rrequirements/dev.txt
commands =
; TODO: Change the path to include all the source files
mypy --strict source
[testenv:bandit]
description = run bandit scan
deps =
bandit
commands =
# Fails the scan if high severity issues are encountered. Can be expanded to support failure on medium severity issues.
bandit -r source --exclude '**/test*' -lll
[testenv:tests.{administrator, cluster-manager, virtual-desktop-controller, sdk, pipeline, infrastructure, library, bootstrap, datamodel}]
description = run unit tests
set_env =
LC_CTYPE=en_US.UTF-8
PYTHONPATH = {env:PYTHONPATH}{:}{toxinidir}{:}{toxinidir}/source/idea/idea-data-model/src{:}{toxinidir}/source/idea/library/src{:}{toxinidir}/source/idea/idea-sdk/src{:}{toxinidir}/source/idea/idea-bootstrap/src{:}{toxinidir}/source/idea/idea-test-utils/src{:}{toxinidir}/source/idea/idea-cluster-manager/src{:}{toxinidir}/source/tests/unit/idea-cluster-manager{:}{toxinidir}/source/idea/idea-administrator/resources{:}{toxinidir}/source/idea/data-model/src
deps =
-rrequirements/dev.txt
commands =
pip install source/idea/idea-data-model/src
pip install source/idea/data-model/src
tests.administrator: coverage run --parallel-mode -m invoke tests.administrator
tests.cluster-manager: coverage run --parallel-mode -m invoke tests.cluster-manager
tests.virtual-desktop-controller: coverage run --parallel-mode -m invoke tests.virtual-desktop-controller
tests.sdk: coverage run --parallel-mode -m invoke tests.sdk
tests.pipeline: coverage run --parallel-mode -m invoke tests.pipeline
tests.infrastructure: coverage run --parallel-mode -m invoke tests.infrastructure
tests.library: coverage run --parallel-mode -m invoke tests.library
tests.datamodel: coverage run --parallel-mode -m invoke tests.datamodel
tests.bootstrap: coverage run --parallel-mode -m invoke tests.bootstrap
[testenv:coverage]
description = combine and generate code coverage report
allowlist_externals =
coverage
cat
rm
set_env =
LC_CTYPE=en_US.UTF-8
PYTHONPATH = {env:PYTHONPATH}{:}{toxinidir}{:}{toxinidir}/source/idea/idea-data-model/src{:}{toxinidir}/source/idea/idea-sdk/src{:}{toxinidir}/source/idea/idea-bootstrap/src{:}{toxinidir}/source/idea/idea-test-utils/src{:}{toxinidir}/source/idea/idea-cluster-manager/src{:}{toxinidir}/source/tests/unit/idea-cluster-manager{:}{toxinidir}/source/idea/idea-administrator/resources{:}{toxinidir}/source/idea/library/src{:}{toxinidir}/source/idea/idea-virtual-desktop-controller/src{:}{toxinidir}/source/idea/data-model/src
deps =
-rrequirements/dev.txt
commands =
rm -f .coverage .coverage.*
coverage run --parallel-mode -m pytest -v source/tests/unit/idea-administrator {posargs}
coverage run --parallel-mode -m pytest -v source/tests/unit/idea-cluster-manager {posargs}
coverage run --parallel-mode -m pytest -v source/tests/unit/idea-virtual-desktop-controller {posargs}
coverage run --parallel-mode -m pytest -v source/tests/unit/idea-sdk {posargs}
coverage run --parallel-mode -m pytest -v source/tests/unit/pipeline {posargs}
coverage run --parallel-mode -m pytest -v source/tests/unit/infrastructure {posargs}
coverage run --parallel-mode -m pytest -v source/idea/library/tests/unit {posargs}
coverage run --parallel-mode -m pytest -v source/idea/data-model/tests/unit {posargs}
coverage run --parallel-mode -m pytest -v source/idea/idea-bootstrap/tests/unit {posargs}
coverage combine
coverage html -i
python source/idea/pipeline/scripts/helpers/generate_cov_report.py
cat summary_report.txt
[testenv:build]
description = build legacy app
skip_install = true
set_env =
LC_CTYPE=en_US.UTF-8
deps =
-rrequirements/dev.txt
commands =
invoke clean
invoke build package
invoke docker.prepare-artifacts
[testenv:npm_audit]
description = run npm audit
change_dir = source/idea/idea-cluster-manager/webapp
deps =
nodeenv
commands =
nodeenv --python-virtualenv
npm i --package-lock-only --force
; TODO: Stop ignoring the npm-audit output
- npm audit --json --audit-level=moderate
[testenv:viperlight_scan]
description = run viperlight scan
deps = nodeenv
allowlist_externals =
rm
bash
curl
unzip
commands =
nodeenv --python-virtualenv
rm -rf viperlight
curl "https://s3.amazonaws.com/viperlight-scanner/latest/viperlight.zip" -o "viperlight.zip"
unzip viperlight.zip -d viperlight
bash -c "pushd viperlight && npm link && popd"
viperlight scan -t .
[testenv:integ-tests.{cluster-manager, ad-sync}]
description = run integ tests
skip_install = true
set_env =
LC_CTYPE=en_US.UTF-8
deps =
-rrequirements/dev.txt
commands =
integ-tests.cluster-manager: invoke integ-tests.cluster-manager {posargs}
integ-tests.ad-sync: invoke integ-tests.ad-sync {posargs}
[testenv:integ-tests.{vdc}]
description = run vdc integ tests
skip_install = true
set_env =
LC_CTYPE=en_US.UTF-8
deps =
-rrequirements/dev.txt
commands =
integ-tests.vdc: invoke integ-tests.vdc {posargs}
[testenv:integ-tests.smoke]
description = run smoke tests
skip_install = true
set_env =
LC_CTYPE=en_US.UTF-8
deps =
-rrequirements/dev.txt
commands =
integ-tests.smoke: invoke integ-tests.smoke {posargs}
[testenv:integ-tests.api]
description = run API tests
skip_install = true
set_env =
LC_CTYPE=en_US.UTF-8
deps =
-rrequirements/dev.txt
commands =
integ-tests.api: invoke integ-tests.api {posargs}