blob: 9936af436cb1aebe2e7894165b8561c0158694c0 [file] [log] [blame]
elinuxhenrik93f015a2020-04-08 11:23:55 +02001# ==================================================================================
2# Copyright (c) 2020 Nordix
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ==================================================================================
elinuxhenrik47837f22020-04-15 14:42:27 +020016
elinuxhenrik93f015a2020-04-08 11:23:55 +020017[tox]
BjornMagnussonXA2d078672020-09-03 15:42:49 +020018envlist = code,docs,docs-linkcheck
elinuxhenrik93f015a2020-04-08 11:23:55 +020019minversion = 2.0
20skipsdist = true
21
BjornMagnussonXA2d078672020-09-03 15:42:49 +020022; basic test and coverage jobs
23[testenv:code]
24basepython = python3.8
25deps=
26 pytest
27 coverage
28 pytest-cov
29 requests
30 connexion
31
32setenv =
33 TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests
34commands =
35; Two test execution with pytest is needed as each simulator version need to be started separately. In addtion, each simulator need
36; environment setup that would cause interference if both simulator are executed in the same pytest run.
37; Each pytest run also need to point to the specific test case file for the reasons mentioned above.
38; Note that the second pytest (additional pytest added in the future) uses the 'append' flag to combine the coverage data
39; from the previous tests. The first pytest shall not have the 'append' since the it is supposed to erase previous coverage data
40; from earlier tox run.
41 pytest --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 \
42 {toxinidir}/near-rt-ric-simulator/tests/OSC_2.1.0/test_osc_2_1_0.py
43 pytest --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
44 --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/STD_1.1.3/test_std_1_1_3.py
45 coverage xml -i
46
elinuxhenrik93f015a2020-04-08 11:23:55 +020047# doc jobs
48[testenv:docs]
49whitelist_externals = echo
50basepython = python3
51deps =
52 sphinx
53 sphinx-rtd-theme
54 sphinxcontrib-httpdomain
55 recommonmark
56 lfdocs-conf
57commands =
58 sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
59 echo "Generated docs available in {toxinidir}/docs/_build/html"
60
61[testenv:docs-linkcheck]
62skipsdist = true
63basepython = python3
64deps = sphinx
65 sphinx-rtd-theme
66 sphinxcontrib-httpdomain
67 recommonmark
68 lfdocs-conf
69commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck