Fix: Add missing tox verify inputs
[sim/a1-interface.git] / tox.ini
1 # ==================================================================================
2 #  Copyright (c) 2020-2023 Nordix
3 #  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
4 #
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 # ==================================================================================
17
18 [tox]
19 envlist = code,docs,docs-linkcheck
20 minversion = 4.0
21 skipsdist = true
22
23 ; basic test and coverage jobs
24 [testenv:code]
25 basepython = python3
26 deps=
27     pytest
28     coverage
29     pytest-cov
30     connexion==2.14.2
31     Flask==2.2.5
32
33 setenv =
34     TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests
35 commands =
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.
42     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 \
43     {toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py
44     pytest -o log_cli=true --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_1_1_3.py
46     pytest -o log_cli=true --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
47     --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_2_0_0.py
48     coverage xml -i
49
50 # doc jobs
51 [testenv:docs]
52 allowlist_externals = echo
53 basepython = python3
54 deps = -r{toxinidir}/docs/requirements-docs.txt
55 commands =
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]
60 skipsdist = true
61 basepython = python3
62 deps = -r{toxinidir}/docs/requirements-docs.txt
63 commands =
64     sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck