X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tox.ini;fp=tox.ini;h=9936af436cb1aebe2e7894165b8561c0158694c0;hb=2d07867317ef49df4cd003899dcc7fe4c01b0352;hp=80839a28d3ffb0bd2f7b885d22000021e73c8805;hpb=7d31c11783b82cb058005242e3d2d0c932c9a04d;p=sim%2Fa1-interface.git diff --git a/tox.ini b/tox.ini index 80839a2..9936af4 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,35 @@ # ================================================================================== [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 + requests + 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/OSC_2.1.0/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/STD_1.1.3/test_std_1_1_3.py + coverage xml -i + # doc jobs [testenv:docs] whitelist_externals = echo