Refactor tests launching procedure
[transportpce.git] / tox.ini
diff --git a/tox.ini b/tox.ini
index a9bb3f1956025734675f2cb996e284591ff1ee4a..281c2e12bde1e84ecd0282cf0a319022bd153a2f 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -66,42 +66,42 @@ commands =
 
 [testenv:testsPCE]
 depends = buildcontroller
+whitelist_externals = launch_tests.sh
+passenv = LAUNCHER
 commands =
-  nosetests --with-xunit transportpce_tests/pce/test_pce.py
-  nosetests --with-xunit transportpce_tests/pce/test_pce_400G.py
+  ./launch_tests.sh pce {posargs:}
 
 [testenv:tests121]
 depends = buildcontroller,sims121,testsPCE
 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
-commands =
-  nosetests --with-xunit transportpce_tests/1.2.1/test_portmapping.py
-  nosetests --with-xunit transportpce_tests/1.2.1/test_topo_portmapping.py
-  nosetests --with-xunit transportpce_tests/1.2.1/test_topology.py
-  nosetests --with-xunit transportpce_tests/1.2.1/test_renderer_service_path_nominal.py
-  nosetests --with-xunit transportpce_tests/1.2.1/test_olm.py
-  nosetests --with-xunit transportpce_tests/1.2.1/test_end2end.py
+whitelist_externals = launch_tests.sh
+passenv = LAUNCHER
+commands =
+  ./launch_tests.sh 1.2.1 {posargs:}
+# By default, all tests in the folder transportpce_tests/1.2.1/ are run.
+# Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
+# For example, 'tox -e tests121 portmapping' will run only the portmapping test.
+# and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
+# Additionnally, a different launcher command than 'nosetests --with-xunit' can be
+# used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
+# which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
+# files attributes.
 
 [testenv:tests221]
 depends = buildcontroller,sims221,tests121
 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
+whitelist_externals = launch_tests.sh
+passenv = LAUNCHER
 commands =
-  nosetests --with-xunit transportpce_tests/2.2.1/test_portmapping.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_topology.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_otn_topology.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_flex_grid.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_otn_renderer.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_otn_sh_renderer.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_olm.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_tapi.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_otn_end2end.py
-  nosetests --with-xunit transportpce_tests/2.2.1/test_end2end.py
+  ./launch_tests.sh 2.2.1 {posargs:}
 
 [testenv:tests71]
 depends = buildcontroller,sims71,tests221
 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
+whitelist_externals = launch_tests.sh
+passenv = LAUNCHER
 commands =
-  nosetests --with-xunit transportpce_tests/7.1/test_portmapping.py
+  ./launch_tests.sh 7.1 {posargs:}
 
 [testenv:gnpy]
 depends = buildcontroller