trigger functional tests in jenkins 44/78544/29
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 7 Dec 2018 15:18:19 +0000 (16:18 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 25 Jan 2019 14:53:15 +0000 (14:53 +0000)
- merge tests/tox.ini with tox.ini by using setupdir variable.
  This way, functional tests can be launched from project root dir.
- adapt sphinx docs testenv consequently
- releng "tox-verify" macro does not bring any maven installation.
  Inside tox, check if mvn is present on the host system. If not,
  call a script to download and install it (yum package is obsolete).
- some tests are still expected to fail.
  forcing tox return codes to success.

JIRA: TRNSPRTPCE-14
Change-Id: I50db9e9894cc5792a0b63f3084bed157df41efe0
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
tests/SH_func_tests.sh
tests/buildTesttool.sh
tests/installMavenCentOS.sh [new file with mode: 0755]
tests/odl_settings.xml [new file with mode: 0644]
tests/tox.ini [deleted file]
tox.ini

index 4b7b597adb3f0888f80a3a19776e4840ecee5a0e..6fbbf4562669210013ecafe6ffa31fe4023d52ed 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-(cd .. && git apply tests/SH_stubs.diff && mvn clean install -DskipTests)
+(cd .. && git apply tests/SH_stubs.diff && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true)
 (cd .. && git checkout .)
 
 exit $?
index 744277bca47810aea81e122299a5d82e436f226a..8e8ee9b8032995840b7fdfc605a18a187ce15113 100755 (executable)
@@ -14,7 +14,7 @@ netconf/netconf/models/ietf-netconf-notifications/src/main/yang/notifications@20
 
 rm -rf netconf mdsal && git submodule update --init
 (cd netconf && patch -p1 < ../netconf.patch )
-(cd netconf/netconf/tools/netconf-testtool && mvn clean install -DskipTests)
+(cd netconf/netconf/tools/netconf-testtool && mvn clean install -s ../../../../odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true)
 rm -rf schemas && mkdir -p schemas
 cp ordmodels_1.2.1/org-openroadm-* schemas
 cp ${yang} schemas
diff --git a/tests/installMavenCentOS.sh b/tests/installMavenCentOS.sh
new file mode 100755 (executable)
index 0000000..34ade73
--- /dev/null
@@ -0,0 +1,8 @@
+#/bin/bash
+
+sudo yum install -y java-1.8.0-openjdk-devel
+wget -nv https://www-us.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz -P /tmp
+sudo mkdir -p /opt
+sudo tar xf /tmp/apache-maven-3.6.0-bin.tar.gz -C /opt
+sudo ln -s /opt/apache-maven-3.6.0 /opt/maven
+sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn
diff --git a/tests/odl_settings.xml b/tests/odl_settings.xml
new file mode 100644 (file)
index 0000000..b7a5b5d
--- /dev/null
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=2 tabstop=2: -->
+<!--
+ Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+  <profiles>
+    <profile>
+      <id>opendaylight-release</id>
+      <repositories>
+        <repository>
+          <id>opendaylight-mirror</id>
+          <name>opendaylight-mirror</name>
+          <url>https://nexus.opendaylight.org/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+            <updatePolicy>never</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>opendaylight-mirror</id>
+          <name>opendaylight-mirror</name>
+          <url>https://nexus.opendaylight.org/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+            <updatePolicy>never</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+
+    <profile>
+      <id>opendaylight-snapshots</id>
+      <repositories>
+        <repository>
+          <id>opendaylight-snapshot</id>
+          <name>opendaylight-snapshot</name>
+          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>opendaylight-snapshot</id>
+          <name>opendaylight-snapshot</name>
+          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+
+  <activeProfiles>
+    <activeProfile>opendaylight-release</activeProfile>
+    <activeProfile>opendaylight-snapshots</activeProfile>
+  </activeProfiles>
+</settings>
diff --git a/tests/tox.ini b/tests/tox.ini
deleted file mode 100644 (file)
index 0401e72..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-[tox]
-envlist = py27
-
-[testenv]
-usedevelop = True
-basepython = python2.7
-deps =
-  -r{toxinidir}/requirements.txt
-  -r{toxinidir}/test-requirements.txt
-whitelist_externals = bash
-commands =
-  {py27,portmapping,topoPortMapping,rspn,topology,pce,olm}: bash -c "(cd .. && mvn clean install -DskipTests -Dmaven.javadoc.skip=true)"
-  {py27,topology,topoPortMapping}: ./buildTesttool.sh
-  {py27,portmapping,rspn,olm}: ./buildHoneynode.sh
-  #py27: nosetests --with-xunit transportpce_tests/
-  {py27,portmapping}: nosetests --with-xunit transportpce_tests/test_portmapping.py
-  {py27,topoPortMapping}: nosetests --with-xunit transportpce_tests/test_topoPortMapping.py
-  {py27,topology}: nosetests --with-xunit transportpce_tests/test_topology.py
-  {py27,rspn}: nosetests --with-xunit transportpce_tests/test_renderer_service_path_nominal.py
-  {py27,pce}: nosetests --with-xunit transportpce_tests/test_pce.py
-  {py27,olm}: nosetests --with-xunit transportpce_tests/test_olm.py
-  {py27,servicehandler}: ./SH_func_tests.sh
-  {py27,servicehandler}: nosetests --with-xunit transportpce_tests/test_servicehandler.py
diff --git a/tox.ini b/tox.ini
index 8d4a48fd5695e7b5b275a60975d277387ab10e15..da2e28de6fe2fff316b42c4af65e545dd8e29b03 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,16 +1,41 @@
 [tox]
 minversion = 1.6
-envlist =
+envlist = py27
     docs
     docs-linkcheck
 skipsdist = true
+setupdir = tests/
+
+[testenv]
+usedevelop = True
+basepython = python2.7
+deps =
+  -r{toxinidir}/tests/requirements.txt
+  -r{toxinidir}/tests/test-requirements.txt
+whitelist_externals = bash
+changedir={toxinidir}/tests
+commands =
+  {py27,portmapping,topoPortMapping,rspn,topology,pce,olm}: - bash -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh  ; fi"
+  {py27,portmapping,topoPortMapping,rspn,topology,pce,olm}: - bash -c "(cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true)"
+  {py27,topology,topoPortMapping}: - ./buildTesttool.sh
+  {py27,portmapping,rspn,olm}: - ./buildHoneynode.sh
+  #py27: nosetests --with-xunit transportpce_tests/
+  {py27,portmapping}: - nosetests --with-xunit transportpce_tests/test_portmapping.py
+  {py27,topoPortMapping}: - nosetests --with-xunit transportpce_tests/test_topoPortMapping.py
+  {py27,topology}: - nosetests --with-xunit transportpce_tests/test_topology.py
+  {py27,rspn}: - nosetests --with-xunit transportpce_tests/test_renderer_service_path_nominal.py
+  {py27,pce}: - nosetests --with-xunit transportpce_tests/test_pce.py
+  {py27,olm}: - nosetests --with-xunit transportpce_tests/test_olm.py
+  {py27,servicehandler}: - ./SH_func_tests.sh
+  {py27,servicehandler}: - nosetests --with-xunit transportpce_tests/test_servicehandler.py
+
 
 [testenv:docs]
 deps = -rdocs/requirements.txt
 commands =
-    sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+    sphinx-build -W -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
 
 [testenv:docs-linkcheck]
 deps = -rdocs/requirements.txt
-commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck