forked from openvinotoolkit/anomalib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
111 lines (104 loc) · 2.95 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
109
110
111
[tox]
isolated_build = True
skip_missing_interpreters = true
envlist =
pre-commit
pre_merge
nightly
snyk-scan
[testenv:pre-commit]
basepython = python3
deps =
pre-commit
commands = pre-commit run --all-files
[testenv:pre_merge]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
deps =
coverage[toml]
pytest
pytest-cov
flaky
nbmake
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/extras.txt
commands =
; 1. Run Coverage First.
pytest tests/pre_merge \
--cov=anomalib \
--cov-report=xml:{toxworkdir}/coverage.xml \
--cov-fail-under=8.5 \
{posargs}
; 2. Test Jupyter Notebooks.
pytest --nbmake notebooks \
--ignore=notebooks/300_benchmarking \
--ignore=notebooks/400_openvino \
--ignore=notebooks/500_use_cases/501_dobot
[testenv:nightly]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
deps =
coverage
pytest
flaky
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/extras.txt
commands =
coverage erase
coverage run --include=anomalib/* -m pytest tests/nightly/
coverage report -m --fail-under=33
coverage xml -o {toxworkdir}/coverage.xml
[testenv:snyk-scan]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
SNYK_ENDPOINT
SNYK_TOKEN
allowlist_externals =
bash
curl
wget
chmod
rm
*snyk*
install_command = pip install --no-cache-dir {opts} {packages}
deps =
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/extras.txt
commands =
bash -c "pip freeze > snyk-req.txt"
curl https://static.snyk.io/cli/latest/snyk-linux -o {toxworkdir}/snyk
chmod +x {toxworkdir}/snyk
{toxworkdir}/snyk config set endpoint={env:SNYK_ENDPOINT}
{toxworkdir}/snyk config set disable-analytics=1
; ignore exit code of the SNYK scanning to generate a report
- {toxworkdir}/snyk test --file=snyk-req.txt --package-manager=pip --sarif-file-output={toxworkdir}/snyk.sarif --json-file-output={toxworkdir}/snyk.json --debug
- {toxworkdir}/snyk monitor --file=snyk-req.txt --package-manager=pip
wget -P .tox/ https://github.com/snyk/snyk-to-html/releases/download/v2.3.6/snyk-to-html-linux
chmod +x {toxworkdir}/snyk-to-html-linux
{toxworkdir}/snyk-to-html-linux -i {toxworkdir}/snyk.json -o {toxworkdir}/snyk.html -d
rm {toxworkdir}/snyk
rm {toxworkdir}/snyk-to-html-linux
rm snyk-req.txt
[testenv:bandit-scan]
skip_install = true
deps =
bandit
allowlist_externals =
bandit
commands =
- bandit -r -c {toxinidir}/.ci/ipas_default.config {toxinidir}/ -f txt -o {toxworkdir}/bandit-report.txt