X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tox.ini;h=8a3aaa6653f1d3ab3179071f9e2977507ce1de37;hb=514637b303ec7dc6390007be1a046189f7a9d169;hp=26cfed72186c2f5a9a8ad9a27c0af6c6d5e8800f;hpb=93f015a0f3677aedb631d93d03f613140ba2fb60;p=sim%2Fa1-interface.git diff --git a/tox.ini b/tox.ini index 26cfed7..8a3aaa6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # ================================================================================== -# Copyright (c) 2020 Nordix +# Copyright (c) 2020-2022 Nordix # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,31 +13,50 @@ # See the License for the specific language governing permissions and # limitations under the License. # ================================================================================== + [tox] -envlist = docs,docs-linkcheck +envlist = code,docs,docs-linkcheck minversion = 2.0 skipsdist = true +; basic test and coverage jobs +[testenv:code] +basepython = python3.8 +deps= + pytest + coverage + pytest-cov + connexion + +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 --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 --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 --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] whitelist_externals = echo -basepython = python3 -deps = - sphinx - sphinx-rtd-theme - sphinxcontrib-httpdomain - recommonmark - lfdocs-conf +basepython = python3.8 +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 = sphinx - sphinx-rtd-theme - sphinxcontrib-httpdomain - recommonmark - lfdocs-conf -commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck +basepython = python3.8 +deps = -r{toxinidir}/docs/requirements-docs.txt +commands = + sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck