blob: 3a1149e87628c5afdc5fbd1ae9587218b98d9cf0 [file] [log] [blame]
elinuxhenrik93f015a2020-04-08 11:23:55 +02001# ==================================================================================
halil.cakal30f41fc2022-07-07 08:53:12 +01002# Copyright (c) 2020-2022 Nordix
elinuxhenrik93f015a2020-04-08 11:23:55 +02003#
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
BjornMagnussonXA2d078672020-09-03 15:42:49 +020029 connexion
30
31setenv =
32 TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests
33commands =
34; Two test execution with pytest is needed as each simulator version need to be started separately. In addtion, each simulator need
35; environment setup that would cause interference if both simulator are executed in the same pytest run.
36; Each pytest run also need to point to the specific test case file for the reasons mentioned above.
37; Note that the second pytest (additional pytest added in the future) uses the 'append' flag to combine the coverage data
38; from the previous tests. The first pytest shall not have the 'append' since the it is supposed to erase previous coverage data
39; from earlier tox run.
40 pytest --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 \
BjornMagnussonXA86810722020-09-23 08:53:27 +020041 {toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py
BjornMagnussonXA2d078672020-09-03 15:42:49 +020042 pytest --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
BjornMagnussonXA86810722020-09-23 08:53:27 +020043 --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_1_1_3.py
BjornMagnussonXA967079b2020-10-23 00:38:18 +020044 pytest --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
45 --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_2_0_0.py
BjornMagnussonXA2d078672020-09-03 15:42:49 +020046 coverage xml -i
47
elinuxhenrik93f015a2020-04-08 11:23:55 +020048# doc jobs
49[testenv:docs]
JohnKeeney5b2b9ef2023-04-27 14:35:48 +010050allowlist_externals = echo
halil.cakal30f41fc2022-07-07 08:53:12 +010051basepython = python3.8
halil.cakalf0ec1252022-08-02 16:17:29 +010052deps = -r{toxinidir}/docs/requirements-docs.txt
elinuxhenrik93f015a2020-04-08 11:23:55 +020053commands =
54 sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
55 echo "Generated docs available in {toxinidir}/docs/_build/html"
56
57[testenv:docs-linkcheck]
58skipsdist = true
halil.cakal30f41fc2022-07-07 08:53:12 +010059basepython = python3.8
halil.cakalf0ec1252022-08-02 16:17:29 +010060deps = -r{toxinidir}/docs/requirements-docs.txt
61commands =
62 sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck