From 1c9894ba0ccb31d64c5b2d15c700b98e332e0672 Mon Sep 17 00:00:00 2001 From: Gwenael Lambrouin Date: Tue, 3 Jan 2023 18:05:09 +0100 Subject: tox: fix testing issues after VM build When the traffic generator VM is built with option -s (use local nfvbench code), the code and the unit test files are copied to nfvbenchvm/dib/elements/nfvbenchvm/static/opt/nfvbench. This can lead to two problems: 1) if pytest is invoked after that, the test collection will fail because of duplicated test files; 2) if flake8 is invoked after that, the same files will be checked twice. To fix this this issue that can occur on a developper's machine, we tell pytest to look for test files in the test/ directory rather than everywhere. This is fine because test/ is the base directory for all test files. Similarly, we tell flake8 to skip the nfvbenchvm/ directory. Change-Id: Idb7f62828db4290f16221bb72bd9c6d5d958f649 Signed-off-by: Gwenael Lambrouin --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 00f262c..a5bd504 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ deps = -chttps://opendev.org/openstack/requirements/raw/branch/stable/yoga/upper-constraints.txt -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = py.test -q --basetemp={envtmpdir} {posargs} +commands = py.test -q --basetemp={envtmpdir} {posargs} test/ [testenv:pep8] basepython = python3.8 @@ -68,7 +68,7 @@ show-source = True #H904: Wrap long lines in parentheses instead of a backslash ignore = E117,E123,E125,E126,E127,E128,E211,E226,E231,E252,E302,E303,E305,E731,W503,W504,H101,H104,H216,H233,H236,H301,H302,H304,H306,H401,H404,H405,H803,H904,D102,D100,D107 builtins = _ -exclude=venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,dib-venv +exclude=venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,nfvbenchvm [testenv:docs] basepython = python3.8 -- cgit 1.2.3-korg