forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
94 lines (82 loc) · 2.21 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
[tox]
isolated_build = true
skip_missing_interpreters = true
[pytest]
addopts = --csv=.tox/tests-{env:TOXENV_TASK}-{env:TOXENV_PYVER}.csv
[testenv]
setenv =
TOX_WORK_DIR={toxworkdir}
passenv =
ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
CI_DATA_ROOT
[testenv:pre-commit]
deps =
pre-commit==2.20.0
skip_install = true
commands =
pre-commit run --all-files
[testenv:unit-test]
deps =
.[dev]
commands_pre =
; [TODO]: Needs to be fixed so that this is not duplicated for each test run
otx install -v
commands =
; Run Unit-Test with coverage report.
pytest tests/unit \
--cov=otx \
--cov-report=xml:{toxworkdir}/coverage.xml \
--cov-report=term-missing \
--cov-fail-under=0 \
{posargs}
[testenv:integration-test]
deps =
.[dev]
commands_pre =
; [TODO]: Needs to be fixed so that this is not duplicated for each test run
otx install -v
commands =
python -m pytest -ra --showlocals --csv={toxworkdir}/{envname}.csv {posargs:tests/integration}
[testenv:build-doc]
deps =
{[testenv:unit-test]deps}
.[docs]
change_dir = {toxinidir}/docs
allowlist_externals =
make
commands =
make html
[testenv:trivy-scan]
deps =
{[testenv:unit-test]deps}
passenv =
{[testenv]passenv}
TRIVY_DOWNLOAD_URL
allowlist_externals =
bash
curl
tar
rm
*trivy*
extras = full
commands =
bash -c "pip freeze > requirements.txt"
curl -L0 {env:TRIVY_DOWNLOAD_URL} -o {toxworkdir}/trivy.tar.gz
tar -xzf {toxworkdir}/trivy.tar.gz -C {toxworkdir}
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml -o {toxworkdir}/trivy-results-otx.txt ./requirements.txt
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml --list-all-pkgs --format template --template "@.ci/csv.tmpl" -o {toxworkdir}/trivy-results-otx.csv ./requirements.txt
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml --format spdx-json -o {toxworkdir}/trivy-spdx-otx.json ./requirements.txt
rm {toxworkdir}/trivy.tar.gz
rm {toxworkdir}/trivy
rm requirements.txt
[testenv:bandit-scan]
skip_install = true
deps =
bandit
allowlist_externals =
bandit
commands =
- bandit -r -c .ci/ipas_default.config {toxinidir}/ -f txt -o {toxworkdir}/bandit-report.txt