You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ap...@apache.org on 2015/05/05 10:43:02 UTC

git commit: updated refs/heads/master to 1eb6f92

Repository: cloudstack
Updated Branches:
  refs/heads/master d849dd628 -> 1eb6f929a


CLOUDSTACK-8429: optimizing travis to run configurable set of tests only after configurable runs


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

Branch: refs/heads/master
Commit: 1eb6f929abc3c0e2e2b98da2f0128d637dd0d86e
Parents: d849dd6
Author: Abhinandan Prateek <ab...@shapeblue.com>
Authored: Tue May 5 14:11:41 2015 +0530
Committer: Abhinandan Prateek <ab...@shapeblue.com>
Committed: Tue May 5 14:11:41 2015 +0530

----------------------------------------------------------------------
 .travis.yml                    | 31 ++++++++++++++++---------------
 tools/travis/after_script.sh   | 21 +++++++++++++++++++++
 tools/travis/before_install.sh | 20 ++++++++++++++++++++
 tools/travis/before_script.sh  | 18 +++++++++++++++++-
 tools/travis/install.sh        | 25 +++++++++++++++++++------
 tools/travis/script.sh         | 28 +++++++++++++++++++++++++++-
 6 files changed, 120 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb6f929/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 0d99d27..200f199 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,25 +24,26 @@ jdk:
 notifications:
   email: false
 env:
-- RUNUNITTESTS=true TESTS=""
-- TESTS="smoke/test_affinity_groups smoke/test_deploy_vms_with_varied_deploymentplanners smoke/test_disk_offerings smoke/test_global_settings"
-- TESTS="smoke/test_portable_publicip smoke/test_primary_storage smoke/test_privategw_acl smoke/test_public_ip_range smoke/test_pvlan smoke/test_regions"
-- TESTS="smoke/test_reset_vm_on_reboot smoke/test_resource_detail smoke/test_routers smoke/test_guest_vlan_range smoke/test_iso"
-- TESTS="smoke/test_secondary_storage smoke/test_service_offerings smoke/test_ssvm smoke/test_templates"
-- TESTS="smoke/test_multipleips_per_nic smoke/test_network smoke/test_non_contigiousvlan smoke/test_over_provisioning"
-- TESTS="smoke/test_volumes smoke/test_vpc_vpn smoke/misc/test_deploy_vm smoke/test_vm_life_cycle component/test_mm_max_limits"
-- TESTS="component/test_acl_isolatednetwork_delete component/test_mm_domain_limits component/test_acl_listsnapshot"
-- TESTS="component/test_acl_listvm component/test_acl_listvolume component/test_acl_sharednetwork_deployVM-impersonation component/test_acl_sharednetwork"
-- TESTS="component/test_snapshots"
+  global:
+     - REGRESSION_CYCLE=4
+     - REGRESSION_INDEX=6
+  matrix:
+    - TESTS="smoke/test_affinity_groups smoke/test_primary_storage"
+    - TESTS="smoke/test_deploy_vms_with_varied_deploymentplanners smoke/test_disk_offerings smoke/test_global_settings smoke/test_multipleips_per_nic"
+    - TESTS="smoke/test_portable_publicip smoke/test_privategw_acl smoke/test_public_ip_range smoke/test_pvlan smoke/test_regions smoke/test_network"
+    - TESTS="smoke/test_reset_vm_on_reboot smoke/test_resource_detail smoke/test_routers smoke/test_guest_vlan_range smoke/test_iso smoke/test_non_contigiousvlan"
+    - TESTS="smoke/test_secondary_storage smoke/test_service_offerings smoke/test_ssvm smoke/test_templates smoke/test_over_provisioning"
+
+    - TESTS="smoke/test_volumes smoke/test_vpc_vpn smoke/misc/test_deploy_vm smoke/test_vm_life_cycle component/test_mm_max_limits"
+    - TESTS="component/test_acl_isolatednetwork_delete component/test_mm_domain_limits component/test_acl_listsnapshot"
+    - TESTS="component/test_acl_listvm component/test_acl_sharednetwork_deployVM-impersonation component/test_acl_sharednetwork"
+    - TESTS="component/test_snapshots component/test_acl_listvolume"
 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/smoke/misc
-- mkdir -p integration-test-results/component
-- 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/$suite.py -s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator || true ; done
-- python ./tools/travis/xunit-reader.py integration-test-results/
+  - travis_wait 30 sleep 30
+  - ./tools/travis/script.sh $TESTS
 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/1eb6f929/tools/travis/after_script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/after_script.sh b/tools/travis/after_script.sh
index 17a9d53..828592d 100755
--- a/tools/travis/after_script.sh
+++ b/tools/travis/after_script.sh
@@ -19,4 +19,25 @@
 # This script should run any tear down commands required.
 #
 
+export TEST_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f1`
+export TEST_SEQUENCE_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f2`
+
+echo "REGRESSION_CYCLE=$REGRESSION_CYCLE"
+echo "TEST_JOB_NUMBER=$TEST_JOB_NUMBER"
+echo "TEST_SEQUENCE_NUMBER=$TEST_SEQUENCE_NUMBER"
+
+#run regression test only on $REGRESSION_CYCLE
+MOD=$(( $TEST_JOB_NUMBER % $REGRESSION_CYCLE ))
+
+echo "MOD=$MOD"
+
+if [ $MOD -ne 0 ]; then
+ if [ $TEST_SEQUENCE_NUMBER -ge $REGRESSION_INDEX ]; then
+   #skip test
+   echo "Skipping tests ... SUCCESS !"
+   exit 0
+ fi
+fi
+
+
 mvn -Dsimulator -pl client jetty:stop 2>&1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb6f929/tools/travis/before_install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh
index 249baed..31efc65 100755
--- a/tools/travis/before_install.sh
+++ b/tools/travis/before_install.sh
@@ -21,6 +21,26 @@
 # or internet downloads.
 #
 
+export TEST_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f1`
+export TEST_SEQUENCE_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f2`
+
+echo "REGRESSION_CYCLE=$REGRESSION_CYCLE"
+echo "TEST_JOB_NUMBER=$TEST_JOB_NUMBER"
+echo "TEST_SEQUENCE_NUMBER=$TEST_SEQUENCE_NUMBER"
+
+#run regression test only on $REGRESSION_CYCLE
+MOD=$(( $TEST_JOB_NUMBER % $REGRESSION_CYCLE ))
+
+echo "MOD=$MOD"
+
+if [ $MOD -ne 0 ]; then
+ if [ $TEST_SEQUENCE_NUMBER -ge $REGRESSION_INDEX ]; then
+   #skip test
+   echo "Skipping tests ... SUCCESS !"
+   exit 0
+ fi
+fi
+
 echo -e "#### System Information ####"
 
 echo -e "\nJava Version: "

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb6f929/tools/travis/before_script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_script.sh b/tools/travis/before_script.sh
index 1d17769..cba50e0 100755
--- a/tools/travis/before_script.sh
+++ b/tools/travis/before_script.sh
@@ -19,6 +19,22 @@
 # This script should be used to bring up the environment.
 #
 
+
+export TEST_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f1`
+export TEST_SEQUENCE_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f2`
+
+#run regression test only on $REGRESSION_CYCLE
+MOD=$(( $TEST_JOB_NUMBER % $REGRESSION_CYCLE ))
+
+if [ $MOD -ne 0 ]; then
+ if [ $TEST_SEQUENCE_NUMBER -ge $REGRESSION_INDEX ]; then
+   #skip test
+   echo "Skipping tests ... SUCCESS !"
+   exit 0
+ fi
+fi
+
+
 export CATALINA_BASE=/opt/tomcat
 export CATALINA_HOME=/opt/tomcat
 export M2_HOME="/usr/local/maven-3.2.1/"
@@ -27,4 +43,4 @@ 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
+python -m marvin.deployDataCenter -i setup/dev/advanced.cfg 2>&1 || true

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb6f929/tools/travis/install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/install.sh b/tools/travis/install.sh
index 0f4857f..3654e42 100755
--- a/tools/travis/install.sh
+++ b/tools/travis/install.sh
@@ -19,19 +19,32 @@
 # This should be used to create the build.
 #
 
+
+export TEST_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f1`
+export TEST_SEQUENCE_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f2`
+
+#run regression test only on $REGRESSION_CYCLE
+MOD=$(( $TEST_JOB_NUMBER % $REGRESSION_CYCLE ))
+
+if [ $MOD -ne 0 ]; then
+ if [ $TEST_SEQUENCE_NUMBER -ge $REGRESSION_INDEX ]; then
+   #skip test
+   echo "Skipping tests ... SUCCESS !"
+   exit 0
+ fi
+fi
+
 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
-if [[ $RUNUNITTESTS == true ]]; then
-    mvn -q -Pimpatient -Dsimulator clean install
+if [ $TEST_SEQUENCE_NUMBER -eq 1 ]; then
+   mvn -q -Pimpatient -Dsimulator clean install
 else
-    mvn -q -Pimpatient -Dsimulator clean install -DskipTests=true
+   mvn -q -Pimpatient -Dsimulator clean install -DskipTests=true
 fi
 
-
 # Compile API Docs
 cd tools/apidoc
 mvn -q clean install
@@ -45,4 +58,4 @@ cd ../../
 
 # Deploy the database
 mvn -q -Pdeveloper -pl developer -Ddeploydb
-mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
\ No newline at end of file
+mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb6f929/tools/travis/script.sh
----------------------------------------------------------------------
diff --git a/tools/travis/script.sh b/tools/travis/script.sh
index 44a55a9..e1c75bb 100755
--- a/tools/travis/script.sh
+++ b/tools/travis/script.sh
@@ -18,4 +18,30 @@
 #
 # This script should be responsible for bring up the
 # test environment and executing the tests.
-#
\ No newline at end of file
+#
+
+export TEST_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f1`
+export TEST_SEQUENCE_NUMBER=`echo $TRAVIS_JOB_NUMBER | cut -d. -f2`
+
+#run regression test only on $REGRESSION_CYCLE
+MOD=$(( $TEST_JOB_NUMBER % $REGRESSION_CYCLE ))
+
+if [ $MOD -ne 0 ]; then
+ if [ $TEST_SEQUENCE_NUMBER -ge $REGRESSION_INDEX ]; then
+   #skip test
+   echo "Skipping tests ... SUCCESS !"
+   exit 0
+ fi
+fi
+
+mkdir -p integration-test-results/smoke/misc
+mkdir -p integration-test-results/component
+
+
+for suite in $1; do
+  travis_wait 30
+  nosetests --with-xunit --xunit-file=integration-test-results/$suite.xml --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/$suite.py -s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator || true ;
+done
+
+
+python ./tools/travis/xunit-reader.py integration-test-results/