Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 1 | # ================================================================================== |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 2 | # Copyright (c) 2019-2020 Nokia |
| 3 | # Copyright (c) 2018-2020 AT&T Intellectual Property. |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # ================================================================================== |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 17 | |
| 18 | # Code |
| 19 | |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 20 | [tox] |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 21 | envlist = py38,flake8,docs,docs-linkcheck |
Tommy Carpenter | 4249398 | 2019-11-06 07:27:16 -0500 | [diff] [blame] | 22 | minversion = 2.0 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 23 | |
| 24 | [testenv] |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 25 | basepython = python3.8 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 26 | deps= |
| 27 | pytest |
| 28 | coverage |
| 29 | pytest-cov |
| 30 | setenv = |
Tommy Carpenter | 296f8de | 2019-08-07 11:38:44 -0400 | [diff] [blame] | 31 | LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64 |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 32 | A1_RMR_RETRY_TIMES = 2 |
| 33 | INSTANCE_DELETE_NO_RESP_TTL = 3 |
| 34 | INSTANCE_DELETE_RESP_TTL = 3 |
Tommy Carpenter | d1cc75a | 2019-08-26 10:12:44 -0400 | [diff] [blame] | 35 | |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame] | 36 | # Note, before this will work, for the first time on that machine, run ./install_deps.sh |
Tommy Carpenter | bb5ad70 | 2019-09-18 08:46:55 -0400 | [diff] [blame] | 37 | commands = |
Tommy Carpenter | 6b69910 | 2019-10-17 13:35:59 -0400 | [diff] [blame] | 38 | # sometimes the -s flag is helpful; add -s after pytest; which streams the logs as they come in, rather than saving them all for the end of tests |
Lott, Christopher (cl778h) | 1e502ff | 2020-03-05 10:26:09 -0500 | [diff] [blame] | 39 | pytest --cov a1 --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 |
Tommy Carpenter | bb5ad70 | 2019-09-18 08:46:55 -0400 | [diff] [blame] | 40 | coverage xml -i |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 41 | |
| 42 | [testenv:flake8] |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 43 | basepython = python3.8 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 44 | skip_install = true |
| 45 | deps = flake8 |
| 46 | commands = flake8 setup.py a1 tests |
| 47 | |
| 48 | [flake8] |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 49 | extend-ignore = E501,E741,E731 |
Tommy Carpenter | 4249398 | 2019-11-06 07:27:16 -0500 | [diff] [blame] | 50 | |
Lott, Christopher (cl778h) | 40bfd96 | 2020-03-22 07:29:16 -0400 | [diff] [blame] | 51 | [testenv:clm] |
| 52 | # use pip to gather dependencies with versions for CLM analysis |
| 53 | whitelist_externals = sh |
| 54 | commands = sh -c 'pip freeze > requirements.txt' |
| 55 | |
Tommy Carpenter | 102b895 | 2020-03-20 10:02:46 -0400 | [diff] [blame] | 56 | # Docs |
| 57 | |
Tommy Carpenter | 4249398 | 2019-11-06 07:27:16 -0500 | [diff] [blame] | 58 | # verbatim as asked for by the docs instructions: https://wiki.o-ran-sc.org/display/DOC/Configure+Repo+for+Documentation |
| 59 | [testenv:docs] |
| 60 | basepython = python3.7 |
| 61 | deps = |
| 62 | sphinx |
| 63 | sphinx-rtd-theme |
| 64 | sphinxcontrib-httpdomain |
| 65 | recommonmark |
| 66 | lfdocs-conf |
| 67 | |
| 68 | commands = |
| 69 | sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html |
| 70 | echo "Generated docs available in {toxinidir}/docs/_build/html" |
| 71 | whitelist_externals = echo |
| 72 | |
| 73 | [testenv:docs-linkcheck] |
| 74 | basepython = python3.7 |
| 75 | deps = sphinx |
| 76 | sphinx-rtd-theme |
| 77 | sphinxcontrib-httpdomain |
| 78 | recommonmark |
| 79 | lfdocs-conf |
| 80 | commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck |