Merge "Modify Python ONAP SDK tests to not require kubeconfig"
[testsuite/pythonsdk-tests.git] / tox.ini
1 [tox]
2 minversion = 3.2.0
3 envlist = json,yaml,py,rst,md
4 skipsdist = true
5 requires = pip >= 8
6
7 [testenv]
8 basepython = python3.8
9 allowlist_externals =
10   git
11   /bin/sh
12   sh
13   /bin/bash
14   bash
15 deps =
16   pyyaml == 3.13
17   bandit == 1.3
18   coala-bears
19   nodeenv
20
21 [testenv:json]
22 commands_pre =
23     /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.json' > /tmp/.coalist_json"
24 commands =
25 # '\ ' at the end of command is needed for a case where above command returns empty list (it adds empty file
26 # parameter to '--files' opt
27     /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn json --files $(</tmp/.coalist_json) \ "
28
29 [testenv:yaml]
30 commands_pre =
31     /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.yaml' '*.yml' > /tmp/.coalist_yaml"
32 commands =
33 # '\ ' at the end of command is needed for a case where above command returns empty list (it adds empty file
34 # parameter to '--files' opt
35     /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn yaml --files $(</tmp/.coalist_yaml) \ "
36
37 [testenv:py]
38 commands_pre =
39     /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.py' > /tmp/.coalist_py"
40 commands =
41     /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn py --files $(</tmp/.coalist_py) \ "
42
43 [testenv:rst]
44 commands_pre =
45     /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.rst' > /tmp/.coalist_rst"
46 deps = -r ./docs/requirements-docs.txt
47 commands =
48   /bin/sh -c "sphinx-build -n -W -b html docs docs/build/html $(</tmp/.coalist_rst)"
49   /bin/sh -c "sphinx-build -n -W -b linkcheck docs docs/build/linkcheck $(</tmp/.coalist_rst)"
50
51 [testenv:md]
52 commands_pre =
53     nodeenv -p --verbose
54     npm install --global remark-cli
55     /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.md' > /tmp/.coalist_md"
56 commands =
57     /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn md --files $(</tmp/.coalist_md) \ "
58