elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 1 | # ================================================================================== |
DenisGNoonan | 7e60269 | 2023-12-15 11:37:19 +0000 | [diff] [blame^] | 2 | # Copyright (c) 2020-2023 Nordix |
| 3 | # Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved. |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 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 | # ================================================================================== |
elinuxhenrik | 47837f2 | 2020-04-15 14:42:27 +0200 | [diff] [blame] | 17 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 18 | [tox] |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 19 | envlist = code,docs,docs-linkcheck |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 20 | minversion = 4.0 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 21 | skipsdist = true |
| 22 | |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 23 | ; basic test and coverage jobs |
| 24 | [testenv:code] |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 25 | basepython = python3 |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 26 | deps= |
| 27 | pytest |
| 28 | coverage |
| 29 | pytest-cov |
DenisGNoonan | 3c47934 | 2023-12-14 13:18:20 +0000 | [diff] [blame] | 30 | connexion==2.14.2 |
| 31 | Flask==2.2.5 |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 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 --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 \ |
BjornMagnussonXA | 8681072 | 2020-09-23 08:53:27 +0200 | [diff] [blame] | 43 | {toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 44 | pytest --cov-append --cov {toxinidir}/near-rt-ric-simulator --cov-report xml --cov-report term-missing --cov-report html \ |
BjornMagnussonXA | 8681072 | 2020-09-23 08:53:27 +0200 | [diff] [blame] | 45 | --cov-fail-under=70 {toxinidir}/near-rt-ric-simulator/tests/test_std_1_1_3.py |
BjornMagnussonXA | 967079b | 2020-10-23 00:38:18 +0200 | [diff] [blame] | 46 | pytest --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 |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 48 | coverage xml -i |
| 49 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 50 | # doc jobs |
| 51 | [testenv:docs] |
JohnKeeney | 5b2b9ef | 2023-04-27 14:35:48 +0100 | [diff] [blame] | 52 | allowlist_externals = echo |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 53 | basepython = python3 |
halil.cakal | f0ec125 | 2022-08-02 16:17:29 +0100 | [diff] [blame] | 54 | deps = -r{toxinidir}/docs/requirements-docs.txt |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 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 |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 61 | basepython = python3 |
halil.cakal | f0ec125 | 2022-08-02 16:17:29 +0100 | [diff] [blame] | 62 | deps = -r{toxinidir}/docs/requirements-docs.txt |
| 63 | commands = |
| 64 | sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck |