elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 1 | # ================================================================================== |
halil.cakal | 30f41fc | 2022-07-07 08:53:12 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020-2022 Nordix |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 3 | # |
| 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 | # ================================================================================== |
elinuxhenrik | 47837f2 | 2020-04-15 14:42:27 +0200 | [diff] [blame] | 16 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 17 | [tox] |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 18 | envlist = code,docs,docs-linkcheck |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 19 | minversion = 4.0 |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 20 | skipsdist = true |
| 21 | |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 22 | ; basic test and coverage jobs |
| 23 | [testenv:code] |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 24 | basepython = python3 |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 25 | deps= |
| 26 | pytest |
| 27 | coverage |
| 28 | pytest-cov |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 29 | connexion |
| 30 | |
| 31 | setenv = |
| 32 | TESTS_BASE_PATH = {toxinidir}/near-rt-ric-simulator/tests |
| 33 | commands = |
| 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 \ |
BjornMagnussonXA | 8681072 | 2020-09-23 08:53:27 +0200 | [diff] [blame] | 41 | {toxinidir}/near-rt-ric-simulator/tests/test_osc_2_1_0.py |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 42 | 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] | 43 | --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] | 44 | 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 |
BjornMagnussonXA | 2d07867 | 2020-09-03 15:42:49 +0200 | [diff] [blame] | 46 | coverage xml -i |
| 47 | |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 48 | # doc jobs |
| 49 | [testenv:docs] |
JohnKeeney | 5b2b9ef | 2023-04-27 14:35:48 +0100 | [diff] [blame] | 50 | allowlist_externals = echo |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 51 | basepython = python3 |
halil.cakal | f0ec125 | 2022-08-02 16:17:29 +0100 | [diff] [blame] | 52 | deps = -r{toxinidir}/docs/requirements-docs.txt |
elinuxhenrik | 93f015a | 2020-04-08 11:23:55 +0200 | [diff] [blame] | 53 | commands = |
| 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] |
| 58 | skipsdist = true |
ktimoney | 4368806 | 2023-06-29 15:30:26 +0100 | [diff] [blame] | 59 | basepython = python3 |
halil.cakal | f0ec125 | 2022-08-02 16:17:29 +0100 | [diff] [blame] | 60 | deps = -r{toxinidir}/docs/requirements-docs.txt |
| 61 | commands = |
| 62 | sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck |