cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From du...@apache.org
Subject git commit: updated refs/heads/master to 26069aa
Date Mon, 01 Sep 2014 09:58:10 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 615c070c0 -> 26069aa37


[CLOUDSTACK-6115] Investigate the use of TravisCI for CloudStack integration testing


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/26069aa3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/26069aa3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/26069aa3

Branch: refs/heads/master
Commit: 26069aa3776ea4b634fb9d614062caa595bc0fa0
Parents: 615c070
Author: Ian Duffy <duffy@apache.org>
Authored: Mon Sep 1 10:56:44 2014 +0100
Committer: Ian Duffy <duffy@apache.org>
Committed: Mon Sep 1 10:56:44 2014 +0100

----------------------------------------------------------------------
 .travis.yml                    | 23 ++++++++++
 tools/travis/after_failure.sh  |  6 +++
 tools/travis/after_script.sh   |  6 +++
 tools/travis/after_success.sh  |  4 ++
 tools/travis/before_install.sh | 50 ++++++++++++++++++++++
 tools/travis/before_script.sh  | 14 ++++++
 tools/travis/install.sh        | 27 ++++++++++++
 tools/travis/script.sh         |  5 +++
 tools/travis/xunit-reader.py   | 85 +++++++++++++++++++++++++++++++++++++
 9 files changed, 220 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..007d466
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+language: java
+cache:
+  directories:
+  - $HOME/.cache
+jdk:
+- oraclejdk7
+notifications:
+  email: false
+env:
+- TESTS="test_affinity_groups test_deploy_vms_with_varied_deploymentplanners test_disk_offerings
test_global_settings test_guest_vlan_range test_iso test_multipleips_per_nic test_network
test_non_contigiousvlan test_over_provisioning"
+- TESTS="test_portable_publicip test_primary_storage test_privategw_acl test_public_ip_range
test_pvlan test_regions test_reset_vm_on_reboot test_resource_detail test_routers"
+- TESTS="test_secondary_storage test_service_offerings test_ssvm test_templates misc/test_deploy_vm
test_vm_life_cycle test_volumes test_vpc_vpn"
+before_install: travis_wait 30 ./tools/travis/before_install.sh
+install: ./tools/travis/install.sh
+before_script: travis_wait 30 ./tools/travis/before_script.sh
+script:
+- mkdir -p integration-test-results/misc
+- travis_wait 30 sleep 30
+- for suite in $TESTS; do travis_wait 30 nosetests --with-xunit --xunit-file=integration-test-results/$suite.xml
--with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/smoke/$suite.py -s -a
tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator ; done
+- python ./tools/travis/xunit-reader.py integration-test-results/
+after_success: ./tools/travis/after_success.sh
+after_failure: ./tools/travis/after_failure.sh
+after_script: ./tools/travis/after_script.sh

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/after_failure.sh
----------------------------------------------------------------------
diff --git a/tools/travis/after_failure.sh b/tools/travis/after_failure.sh
new file mode 100755
index 0000000..d0ea01d
--- /dev/null
+++ b/tools/travis/after_failure.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+#
+# As the filename suggests, this is executed on build failure
+# failure.
+#
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/after_script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/after_script.sh b/tools/travis/after_script.sh
new file mode 100755
index 0000000..721de64
--- /dev/null
+++ b/tools/travis/after_script.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+#
+# This script should run any tear down commands required.
+#
+
+mvn -Dsimulator -pl client jetty:stop 2>&1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/after_success.sh
----------------------------------------------------------------------
diff --git a/tools/travis/after_success.sh b/tools/travis/after_success.sh
new file mode 100755
index 0000000..5ca7ff0
--- /dev/null
+++ b/tools/travis/after_success.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+#
+# As the filename suggests this is executed on build success.
+#

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/before_install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh
new file mode 100755
index 0000000..aff3e56
--- /dev/null
+++ b/tools/travis/before_install.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# This script should be used to install additional dependencies
+# This includes: installing ubuntu packages, custom services
+# or internet downloads.
+#
+
+echo -e "#### System Information ####"
+
+echo -e "\nJava Version: "
+javac -version
+
+echo -e "\nMaven Version: "
+mvn -v
+
+echo -e "\nUpdating the system: "
+sudo apt-get -q -y update > /dev/null
+
+echo -e "\nInstalling MySQL: "
+
+sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password
your_password'
+sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password
your_password'
+sudo apt-get -q -y install mysql-server > /dev/null
+
+sudo /etc/init.d/mysql start
+
+echo -e "\nInstalling Tomcat: "
+wget -q -O tomcat.tar.gz http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.tar.gz
+sudo mkdir -p /opt/tomcat
+sudo tar xfv tomcat.tar.gz -C /opt/tomcat --strip 1 > /dev/null
+
+echo -e "\nInstalling Development tools: "
+
+sudo apt-get -q -y install uuid-runtime genisoimage python-setuptools python-pip netcat >
/dev/null
+
+echo "<settings>
+  <mirrors>
+    <mirror>
+      <id>Central</id>
+      <url>http://repo1.maven.org/maven2</url>
+      <mirrorOf>central</mirrorOf>
+      <!-- United States, St. Louis-->
+    </mirror>
+  </mirrors>
+</settings>" > ~/.m2/settings.xml
+
+echo -e "\nInstalling some python packages: "
+
+sudo pip install lxml > /dev/null
+sudo pip install texttable > /dev/null

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/before_script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_script.sh b/tools/travis/before_script.sh
new file mode 100755
index 0000000..607ed1b
--- /dev/null
+++ b/tools/travis/before_script.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# This script should be used to bring up the environment.
+#
+
+export CATALINA_BASE=/opt/tomcat
+export CATALINA_HOME=/opt/tomcat
+export M2_HOME="/usr/local/maven-3.2.1/"
+export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m"
+
+mvn -Dsimulator -pl :cloud-client-ui jetty:run 2>&1 > /dev/null &
+
+while ! nc -vz localhost 8096 2>&1 > /dev/null; do sleep 10; done
+python -m marvin.deployDataCenter -i setup/dev/advanced.cfg 2>&1 || true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/install.sh b/tools/travis/install.sh
new file mode 100755
index 0000000..f8b22d4
--- /dev/null
+++ b/tools/travis/install.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# This should be used to create the build.
+#
+
+export CATALINA_BASE=/opt/tomcat
+export CATALINA_HOME=/opt/tomcat
+export M2_HOME="/usr/local/maven-3.2.1/"
+export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m"
+
+# Compile Cloudstack
+mvn -q -Pimpatient -Dsimulator clean install
+
+# Compile API Docs
+cd tools/apidoc
+mvn -q clean install
+cd ../../
+
+# Compile marvin
+cd tools/marvin
+mvn -q clean install
+sudo python setup.py install 2>&1 > /dev/null
+cd ../../
+
+# Deploy the database
+mvn -q -Pdeveloper -pl developer -Ddeploydb
+mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/script.sh b/tools/travis/script.sh
new file mode 100755
index 0000000..72b9ee2
--- /dev/null
+++ b/tools/travis/script.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+# This script should be responsible for bring up the
+# test environment and executing the tests.
+#
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26069aa3/tools/travis/xunit-reader.py
----------------------------------------------------------------------
diff --git a/tools/travis/xunit-reader.py b/tools/travis/xunit-reader.py
new file mode 100755
index 0000000..8cf8fe8
--- /dev/null
+++ b/tools/travis/xunit-reader.py
@@ -0,0 +1,85 @@
+# !/usr/bin/env python
+# encoding: utf-8
+
+"""
+This script provides parsing of xunit xml files.
+
+"""
+
+import os
+import argparse
+
+import texttable
+
+import lxml.etree
+
+
+def main():
+    """
+    Entry point for the parser
+
+    """
+
+    args = _generate_args()
+    file_path_list = _generate_file_list(args)
+
+    exit(parse_reports(file_path_list))
+
+
+def _generate_args():
+    parser = argparse.ArgumentParser(
+        description='Command line utility for reading xunit xml files'
+    )
+
+    parser.add_argument(
+        'path',
+        metavar='/path/to/folder/containing/xunit-reports',
+        type=str,
+        help='A path to a folder containing xunit reports'
+    )
+
+    args = parser.parse_args()
+
+    return vars(args)
+
+
+def _generate_file_list(args):
+    path = args.pop('path')
+    file_path_list = []
+    for (root, dirnames, filenames) in os.walk(path):
+        for filename in filenames:
+            if filename.endswith('.xml'):
+                file_path_list.append(os.path.join(root, filename))
+
+    return file_path_list
+
+
+def parse_reports(file_path_list):
+    table = texttable.Texttable()
+    table.header(['Test', 'Result'])
+
+    exit_code = 0
+
+    for file_path in file_path_list:
+        data = lxml.etree.iterparse(file_path, tag='testcase')
+        for event, elem in data:
+            name = ''
+            status = 'Success'
+            if 'name' in elem.attrib:
+                name = elem.attrib['name']
+            for children in elem.getchildren():
+                if 'skipped' == children.tag:
+                    status = 'Skipped'
+                elif 'failure' == children.tag:
+                    exit_code = 1
+                    status = 'Failure'
+
+            table.add_row([name, status])
+
+    print table.draw()
+
+    return exit_code
+
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file


Mime
View raw message