blob: 4a319cbaaaa85ce7a27c8ba108db167a5c89b75e [file] [log] [blame]
Tommy Carpenter5ad8f032019-05-30 14:33:21 -04001# ==================================================================================
Tommy Carpenter102b8952020-03-20 10:02:46 -04002# Copyright (c) 2019-2020 Nokia
3# Copyright (c) 2018-2020 AT&T Intellectual Property.
Tommy Carpenter5ad8f032019-05-30 14:33:21 -04004#
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 Carpenter102b8952020-03-20 10:02:46 -040017
18# Code
19
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040020[tox]
Lott, Christopher (cl778h)14d016e2020-04-27 10:45:47 -040021envlist = code,flake8,docs,docs-linkcheck
Tommy Carpenter42493982019-11-06 07:27:16 -050022minversion = 2.0
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040023
Lott, Christopher (cl778h)14d016e2020-04-27 10:45:47 -040024[pytest]
25testpaths = tests
26
27[testenv:code]
Tommy Carpenter102b8952020-03-20 10:02:46 -040028basepython = python3.8
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040029deps=
30 pytest
31 coverage
32 pytest-cov
33setenv =
Tommy Carpenter296f8de2019-08-07 11:38:44 -040034 LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
Tommy Carpenter0a3f6762019-11-06 09:24:16 -050035 A1_RMR_RETRY_TIMES = 2
36 INSTANCE_DELETE_NO_RESP_TTL = 3
37 INSTANCE_DELETE_RESP_TTL = 3
Lott, Christopher (cl778h)c91a4a12020-05-27 15:56:20 -040038 prometheus_multiproc_dir = /tmp
Tommy Carpenterd1cc75a2019-08-26 10:12:44 -040039
Tommy Carpenter24514462019-07-16 11:25:52 -040040# Note, before this will work, for the first time on that machine, run ./install_deps.sh
Tommy Carpenterbb5ad702019-09-18 08:46:55 -040041commands =
Tommy Carpenter6b699102019-10-17 13:35:59 -040042# 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
E. Scott Danielscf9eaf82020-10-19 14:13:40 -040043 pytest --cov a1 --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml
Tommy Carpenterbb5ad702019-09-18 08:46:55 -040044 coverage xml -i
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040045
46[testenv:flake8]
Tommy Carpenter102b8952020-03-20 10:02:46 -040047basepython = python3.8
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040048skip_install = true
49deps = flake8
50commands = flake8 setup.py a1 tests
51
52[flake8]
Tommy Carpenter0a3f6762019-11-06 09:24:16 -050053extend-ignore = E501,E741,E731
Tommy Carpenter42493982019-11-06 07:27:16 -050054
Lott, Christopher (cl778h)40bfd962020-03-22 07:29:16 -040055[testenv:clm]
56# use pip to gather dependencies with versions for CLM analysis
57whitelist_externals = sh
58commands = sh -c 'pip freeze > requirements.txt'
59
Tommy Carpenter102b8952020-03-20 10:02:46 -040060# Docs
61
Tommy Carpenter42493982019-11-06 07:27:16 -050062# verbatim as asked for by the docs instructions: https://wiki.o-ran-sc.org/display/DOC/Configure+Repo+for+Documentation
63[testenv:docs]
64basepython = python3.7
65deps =
66 sphinx
67 sphinx-rtd-theme
68 sphinxcontrib-httpdomain
69 recommonmark
70 lfdocs-conf
71
72commands =
73 sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
74 echo "Generated docs available in {toxinidir}/docs/_build/html"
75whitelist_externals = echo
76
77[testenv:docs-linkcheck]
78basepython = python3.7
79deps = sphinx
80 sphinx-rtd-theme
81 sphinxcontrib-httpdomain
82 recommonmark
83 lfdocs-conf
84commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck