Improve tox tests parallelization with Karaf 02/96802/4
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 5 Jul 2021 09:08:00 +0000 (11:08 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 17 Aug 2021 23:05:44 +0000 (01:05 +0200)
JIRA: TRNSPRTPCE-482
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I71038c8c51719158694167e95c26833978d0ff86

tests/build_karaf_for_tests.sh [new file with mode: 0755]
tests/launch_tests.sh
tox.ini

diff --git a/tests/build_karaf_for_tests.sh b/tests/build_karaf_for_tests.sh
new file mode 100755 (executable)
index 0000000..3476e71
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ -z "$USE_ODL_ALT_KARAF_INSTALL_DIR" ]; then
+    exit
+fi
+
+cd $(dirname $0)
+
+if [ -f ../"$USE_ODL_ALT_KARAF_INSTALL_DIR"/target/assembly/bin/karaf_ ]; then
+    exit
+fi
+
+. ./reflectwarn.sh
+cd  ../$USE_ODL_ALT_KARAF_INSTALL_DIR
+mvn clean install -B -q -s ../tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true
+./target/assembly/ressources/post_install_for_tests.sh
index c62307bd97665647133965a4b6fcda18610ec1e6..f1951c2205bf83d9186a62c7c77060df8e3bb3c9 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+if [ "$USE_LIGHTY" != "True" ]; then
+    ./build_karaf_for_tests.sh
+fi
+
 for arg in $@; do
     if [ -z "$test_suite" ]; then
         test_suite=$1
diff --git a/tox.ini b/tox.ini
index eada9910096a6ca402f73f59950a38f17582f6d3..09a596799351964c1607c7dab07280cfe3f360ef 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -37,7 +37,6 @@ commands =
   sh -c "mv  ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java_  ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
 #patch Karaf exec for the same reason at runtime and also to have the possibility to use alternative ports
   sh -c "../karaf/target/assembly/ressources/post_install_for_tests.sh"
-  sh -c 'if [ "$USE_LIGHTY" != "True" ]; then . $PWD/reflectwarn.sh && (for suffix in 121 221 71; do cd  ../"karaf$suffix"/; mvn clean install -B -q -s ../tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true; ./target/assembly/ressources/post_install_for_tests.sh;done) ; fi'
 #build Lighty if needed
   sh -c 'if [ "$USE_LIGHTY" = "True" ]; then (cd ../lighty && ./build.sh); fi'