blob: 4d0a6a7924e3331b8f90c4388c426eafeb15897a [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]
Tommy Carpenter102b8952020-03-20 10:02:46 -040021envlist = py38,flake8,docs,docs-linkcheck
Tommy Carpenter42493982019-11-06 07:27:16 -050022minversion = 2.0
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040023
24[testenv]
Tommy Carpenter102b8952020-03-20 10:02:46 -040025basepython = python3.8
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040026deps=
27 pytest
28 coverage
29 pytest-cov
30setenv =
Tommy Carpenter296f8de2019-08-07 11:38:44 -040031 LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
Tommy Carpenter0a3f6762019-11-06 09:24:16 -050032 A1_RMR_RETRY_TIMES = 2
33 INSTANCE_DELETE_NO_RESP_TTL = 3
34 INSTANCE_DELETE_RESP_TTL = 3
Tommy Carpenterd1cc75a2019-08-26 10:12:44 -040035
Tommy Carpenter24514462019-07-16 11:25:52 -040036# Note, before this will work, for the first time on that machine, run ./install_deps.sh
Tommy Carpenterbb5ad702019-09-18 08:46:55 -040037commands =
Tommy Carpenter6b699102019-10-17 13:35:59 -040038# 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)1e502ff2020-03-05 10:26:09 -050039 pytest --cov a1 --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70
Tommy Carpenterbb5ad702019-09-18 08:46:55 -040040 coverage xml -i
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040041
42[testenv:flake8]
Tommy Carpenter102b8952020-03-20 10:02:46 -040043basepython = python3.8
Tommy Carpenter5ad8f032019-05-30 14:33:21 -040044skip_install = true
45deps = flake8
46commands = flake8 setup.py a1 tests
47
48[flake8]
Tommy Carpenter0a3f6762019-11-06 09:24:16 -050049extend-ignore = E501,E741,E731
Tommy Carpenter42493982019-11-06 07:27:16 -050050
Lott, Christopher (cl778h)40bfd962020-03-22 07:29:16 -040051[testenv:clm]
52# use pip to gather dependencies with versions for CLM analysis
53whitelist_externals = sh
54commands = sh -c 'pip freeze > requirements.txt'
55
Tommy Carpenter102b8952020-03-20 10:02:46 -040056# Docs
57
Tommy Carpenter42493982019-11-06 07:27:16 -050058# verbatim as asked for by the docs instructions: https://wiki.o-ran-sc.org/display/DOC/Configure+Repo+for+Documentation
59[testenv:docs]
60basepython = python3.7
61deps =
62 sphinx
63 sphinx-rtd-theme
64 sphinxcontrib-httpdomain
65 recommonmark
66 lfdocs-conf
67
68commands =
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"
71whitelist_externals = echo
72
73[testenv:docs-linkcheck]
74basepython = python3.7
75deps = sphinx
76 sphinx-rtd-theme
77 sphinxcontrib-httpdomain
78 recommonmark
79 lfdocs-conf
80commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck