blob: 7d421c54ba98dac0782901a9dbb9e0e197582bd3 [file] [log] [blame]
elinuxhenrik93f015a2020-04-08 11:23:55 +02001# ==================================================================================
DenisGNoonan7e602692023-12-15 11:37:19 +00002# Copyright (c) 2020-2023 Nordix
aravind.est8873ea52024-01-12 11:19:17 +00003# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
elinuxhenrik93f015a2020-04-08 11:23:55 +02004#
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# ==================================================================================
elinuxhenrik47837f22020-04-15 14:42:27 +020017
elinuxhenrik93f015a2020-04-08 11:23:55 +020018[tox]
BjornMagnussonXA2d078672020-09-03 15:42:49 +020019envlist = code,docs,docs-linkcheck
ktimoney43688062023-06-29 15:30:26 +010020minversion = 4.0
elinuxhenrik93f015a2020-04-08 11:23:55 +020021skipsdist = true
22
BjornMagnussonXA2d078672020-09-03 15:42:49 +020023; basic test and coverage jobs
24[testenv:code]
ktimoney43688062023-06-29 15:30:26 +010025basepython = python3
BjornMagnussonXA2d078672020-09-03 15:42:49 +020026deps=
27 pytest
28 coverage
29 pytest-cov
DenisGNoonan3c479342023-12-14 13:18:20 +000030 connexion==2.14.2
31 Flask==2.2.5
BjornMagnussonXA2d078672020-09-03 15:42:49 +020032
33setenv =
34 TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests
35commands =
36; Two test execution with pytest is needed as each simulator version need to be started separately. In addtion, each simulator need
37; environment setup that would cause interference if both simulator are executed in the same pytest run.
38; Each pytest run also need to point to the specific test case file for the reasons mentioned above.
39; Note that the second pytest (additional pytest added in the future) uses the 'append' flag to combine the coverage data
40; from the previous tests. The first pytest shall not have the 'append' since the it is supposed to erase previous coverage data
41; from earlier tox run.
aravind.est8873ea52024-01-12 11:19:17 +000042 pytest -o log_cli=true --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 +020043 {toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py
aravind.est8873ea52024-01-12 11:19:17 +000044 pytest -o log_cli=true --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
BjornMagnussonXA86810722020-09-23 08:53:27 +020045 --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_1_1_3.py
aravind.est8873ea52024-01-12 11:19:17 +000046 pytest -o log_cli=true --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
BjornMagnussonXA967079b2020-10-23 00:38:18 +020047 --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_2_0_0.py
BjornMagnussonXA2d078672020-09-03 15:42:49 +020048 coverage xml -i
49
elinuxhenrik93f015a2020-04-08 11:23:55 +020050# doc jobs
51[testenv:docs]
JohnKeeney5b2b9ef2023-04-27 14:35:48 +010052allowlist_externals = echo
ktimoney43688062023-06-29 15:30:26 +010053basepython = python3
halil.cakalf0ec1252022-08-02 16:17:29 +010054deps = -r{toxinidir}/docs/requirements-docs.txt
elinuxhenrik93f015a2020-04-08 11:23:55 +020055commands =
56 sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
57 echo "Generated docs available in {toxinidir}/docs/_build/html"
58
59[testenv:docs-linkcheck]
60skipsdist = true
ktimoney43688062023-06-29 15:30:26 +010061basepython = python3
halil.cakalf0ec1252022-08-02 16:17:29 +010062deps = -r{toxinidir}/docs/requirements-docs.txt
63commands =
64 sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck