You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/03/27 14:16:45 UTC

[1/2] camel git commit: CAMEL-9766: camel-itest-karaf to get working on karaf 4. Use a script to run the tests reliable.

Repository: camel
Updated Branches:
  refs/heads/master ff1fb0e39 -> c3f865ada


CAMEL-9766: camel-itest-karaf to get working on karaf 4. Use a script to run the tests reliable.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/015cc1a3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/015cc1a3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/015cc1a3

Branch: refs/heads/master
Commit: 015cc1a304948b018e2816dae4298385eced8d03
Parents: ff1fb0e
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Mar 27 13:51:42 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Mar 27 13:51:42 2016 +0200

----------------------------------------------------------------------
 tests/camel-itest-karaf/run-tests.sh | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/015cc1a3/tests/camel-itest-karaf/run-tests.sh
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/run-tests.sh b/tests/camel-itest-karaf/run-tests.sh
new file mode 100755
index 0000000..6b85e6d
--- /dev/null
+++ b/tests/camel-itest-karaf/run-tests.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+## This script runs the camel-itest-karaf in a more reliable way
+## than Maven surefire will do as it can hang after a while
+## The script also kills each karaf container after a test to ensure there is no Java JVMs
+## danging around.
+
+echo "Running tests and kill karaf after each test"
+
+FILES=src/test/java/org/apache/camel/itest/karaf/*
+
+for filename in $FILES
+do
+  testname=$(basename ${filename%.*})
+  if [ $testname != "AbstractFeatureTest" ]
+  then
+    echo "Running test $testname"
+    mvn test -Dtest=$testname
+    ## TODO: wonder if we can get exit code from mvn, and fail if its not 0 ?
+    echo "Killing Karaf to ensure no dangling karaf running"
+    jps -l | grep karaf | cut -d ' ' -f 1 | xargs -n1 kill -kill
+  fi  
+done


[2/2] camel git commit: CAMEL-9766: camel-itest-karaf to get working on karaf 4. Use a script to run the tests reliable.

Posted by da...@apache.org.
CAMEL-9766: camel-itest-karaf to get working on karaf 4. Use a script to run the tests reliable.


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

Branch: refs/heads/master
Commit: c3f865ada4af0f0adbe2d064e39377f0f1916890
Parents: 015cc1a
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Mar 27 14:16:34 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Mar 27 14:16:34 2016 +0200

----------------------------------------------------------------------
 tests/camel-itest-karaf/run-tests.sh | 38 ++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c3f865ad/tests/camel-itest-karaf/run-tests.sh
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/run-tests.sh b/tests/camel-itest-karaf/run-tests.sh
index 6b85e6d..88ed7cb 100755
--- a/tests/camel-itest-karaf/run-tests.sh
+++ b/tests/camel-itest-karaf/run-tests.sh
@@ -26,14 +26,46 @@ echo "Running tests and kill karaf after each test"
 
 FILES=src/test/java/org/apache/camel/itest/karaf/*
 
+## you can pass in the test name to start from eg run-tests.sh CamelFtpTest
+## to start testing from this test and onwards.
+if [ "$#" -eq  "0" ]
+then
+  found=1
+else
+  found=0
+fi  
+
 for filename in $FILES
 do
   testname=$(basename ${filename%.*})
-  if [ $testname != "AbstractFeatureTest" ]
+
+  if [ $found -eq 0 ]
+  then
+    if [ $testname == "$1" ]
+    then
+     found=1
+    fi 
+  fi
+
+  if [ $found -eq 1 ] && [ $testname != "AbstractFeatureTest" ]
   then
+    echo "*******************************************************************"
     echo "Running test $testname"
-    mvn test -Dtest=$testname
-    ## TODO: wonder if we can get exit code from mvn, and fail if its not 0 ?
+    echo "*******************************************************************"
+    if mvn test -Dtest=$testname ; then
+      echo "\n"
+      echo "*******************************************************************"
+      echo "Test success: $testname"
+      echo "*******************************************************************"
+      echo "\n"
+    else
+      echo "\n"
+      echo "*******************************************************************"
+      echo "Test failure: $testname"
+      echo "*******************************************************************"
+      echo "\n"
+      exit 1;
+    fi  
     echo "Killing Karaf to ensure no dangling karaf running"
     jps -l | grep karaf | cut -d ' ' -f 1 | xargs -n1 kill -kill
   fi