-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
64 lines (59 loc) · 2.9 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# ==================================================================================
# Copyright (c) 2020-2023 Nordix
# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
[tox]
envlist = code,docs,docs-linkcheck
minversion = 4.0
skipsdist = true
; basic test and coverage jobs
[testenv:code]
basepython = python3
deps=
pytest
coverage
pytest-cov
connexion==2.14.2
Flask==2.2.5
setenv =
TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests
commands =
; Two test execution with pytest is needed as each simulator version need to be started separately. In addtion, each simulator need
; environment setup that would cause interference if both simulator are executed in the same pytest run.
; Each pytest run also need to point to the specific test case file for the reasons mentioned above.
; Note that the second pytest (additional pytest added in the future) uses the 'append' flag to combine the coverage data
; from the previous tests. The first pytest shall not have the 'append' since the it is supposed to erase previous coverage data
; from earlier tox run.
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 \
{toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py
pytest -o log_cli=true --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
--cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_1_1_3.py
pytest -o log_cli=true --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \
--cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_2_0_0.py
coverage xml -i
# doc jobs
[testenv:docs]
allowlist_externals = echo
basepython = python3
deps = -r{toxinidir}/docs/requirements-docs.txt
commands =
sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
echo "Generated docs available in {toxinidir}/docs/_build/html"
[testenv:docs-linkcheck]
skipsdist = true
basepython = python3
deps = -r{toxinidir}/docs/requirements-docs.txt
commands =
sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck