hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1546086 - in /hive/trunk/testutils/ptest2/src: main/java/org/apache/hive/ptest/execution/ main/resources/ test/java/org/apache/hive/ptest/execution/
Date Wed, 27 Nov 2013 16:07:50 GMT
Author: brock
Date: Wed Nov 27 16:07:49 2013
New Revision: 1546086

URL: http://svn.apache.org/r1546086
Log:
HIVE-5894 - Fix minor PTest2 issues (Brock Noland)

Added:
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.testShutdownBeforeExec.approved.txt
Modified:
    hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java
    hive/trunk/testutils/ptest2/src/main/resources/batch-exec.vm
    hive/trunk/testutils/ptest2/src/main/resources/source-prep.vm
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.java
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
    hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt

Modified: hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java (original)
+++ hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/PTest.java Wed
Nov 27 16:07:49 2013
@@ -43,6 +43,7 @@ import org.apache.hive.ptest.execution.c
 import org.apache.hive.ptest.execution.conf.TestParser;
 import org.apache.hive.ptest.execution.context.ExecutionContext;
 import org.apache.hive.ptest.execution.context.ExecutionContextProvider;
+import org.apache.hive.ptest.execution.ssh.NonZeroExitCodeException;
 import org.apache.hive.ptest.execution.ssh.RSyncCommandExecutor;
 import org.apache.hive.ptest.execution.ssh.SSHCommandExecutor;
 import org.apache.velocity.app.Velocity;
@@ -171,7 +172,17 @@ public class PTest {
       }
     } catch(Throwable throwable) {
       mLogger.error("Test run exited with an unexpected error", throwable);
-      messages.add("Tests failed with: " + throwable.getClass().getSimpleName() + ": " +
throwable.getMessage());
+      // NonZeroExitCodeExceptions can have long messages and should be
+      // trimmable when published to the JIRA via the JiraService
+      if(throwable instanceof NonZeroExitCodeException) {
+        messages.add("Tests exited with: " + throwable.getClass().getSimpleName());
+        for(String line : Strings.nullToEmpty(throwable.getMessage()).split("\n")) {
+          messages.add(line);
+        }
+      } else {
+        messages.add("Tests exited with: " + throwable.getClass().getSimpleName() +
+            ": " + throwable.getMessage());
+      }
       error = true;
     } finally {
       for(HostExecutor hostExecutor : mHostExecutors) {

Modified: hive/trunk/testutils/ptest2/src/main/resources/batch-exec.vm
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/main/resources/batch-exec.vm?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/main/resources/batch-exec.vm (original)
+++ hive/trunk/testutils/ptest2/src/main/resources/batch-exec.vm Wed Nov 27 16:07:49 2013
@@ -59,7 +59,7 @@ then
   testModule=$(find ./ -name '${testClass}.java' | awk -F'/' '{print $2}')
   if [[ -z "$testModule" ]]
   then
-  	testModule=./
+    testModule=./
   fi
   pushd $testModule
   timeout 2h mvn -B -o test -Dmaven.repo.local=$localDir/$instanceName/maven \

Modified: hive/trunk/testutils/ptest2/src/main/resources/source-prep.vm
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/main/resources/source-prep.vm?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/main/resources/source-prep.vm (original)
+++ hive/trunk/testutils/ptest2/src/main/resources/source-prep.vm Wed Nov 27 16:07:49 2013
@@ -58,7 +58,7 @@ cd $workingDir/
     fi
     if [[ -d ${repositoryName}-source ]] && [[ ! -d ${repositoryName}-source/.git
]]
     then
-      rm -rf ${repositoryName}-source	  
+      rm -rf ${repositoryName}-source
     fi
     if [[ ! -d ${repositoryName}-source ]]
     then
@@ -85,11 +85,11 @@ cd $workingDir/
   if [[ "${buildTool}" == "maven" ]]
   then
     rm -rf $workingDir/maven/org/apache/hive
-    mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven
-    mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs
     cd itests
-    mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven
-    mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=$workingDir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=$workingDir/maven -Dtest=TestDummy $mavenArgs
   elif [[ "${buildTool}" == "ant" ]]
   then
     ant $antArgs -Divy.default.ivy.user.dir=$workingDir/ivy \

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.java
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.java?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.java
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.java
Wed Nov 27 16:07:49 2013
@@ -203,7 +203,7 @@ public class TestHostExecutor {
     executor.submitTests(parallelWorkQueue, isolatedWorkQueue, failedTestResults).get();
     Assert.assertEquals(Collections.emptySet(),  failedTestResults);
     Assert.assertEquals(parallelWorkQueue.toString(), 1, parallelWorkQueue.size());
-    Approvals.verify(getExecutedCommands());
+    Approvals.verify("EMPTY\n" + getExecutedCommands());
     Assert.assertTrue(executor.isShutdown());
   }
   @Test

Added: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.testShutdownBeforeExec.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.testShutdownBeforeExec.approved.txt?rev=1546086&view=auto
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.testShutdownBeforeExec.approved.txt
(added)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestHostExecutor.testShutdownBeforeExec.approved.txt
Wed Nov 27 16:07:49 2013
@@ -0,0 +1 @@
+EMPTY

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.java
Wed Nov 27 16:07:49 2013
@@ -63,6 +63,7 @@ public class TestScripts  {
     templateVariables.put("workingDir", "/some/working/dir");
     templateVariables.put("buildTool", "maven");
     templateVariables.put("antArgs", "-Dant=arg1");
+    templateVariables.put("mavenArgs", "-Dant=arg1");
     templateVariables.put("testClass", "TestCliDriver");
     templateVariables.put("buildTag", "build-1");
     templateVariables.put("logDir", "/some/log/dir");

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt
Wed Nov 27 16:07:49 2013
@@ -58,7 +58,7 @@ then
   testModule=$(find ./ -name 'TestCliDriver.java' | awk -F'/' '{print $2}')
   if [[ -z "$testModule" ]]
   then
-  	testModule=./
+    testModule=./
   fi
   pushd $testModule
   timeout 2h mvn -B -o test -Dmaven.repo.local=/some/local/dir/instance-1/maven \

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt
Wed Nov 27 16:07:49 2013
@@ -58,11 +58,11 @@ then
   testModule=$(find ./ -name 'TestCliDriver.java' | awk -F'/' '{print $2}')
   if [[ -z "$testModule" ]]
   then
-  	testModule=./
+    testModule=./
   fi
   pushd $testModule
   timeout 2h mvn -B -o test -Dmaven.repo.local=/some/local/dir/instance-1/maven \
-    $mavenArgs $mavenTestArgs -Dtest=arg1 1>/some/log/dir/maven-test.txt 2>&1 </dev/null
&
+    -Dant=arg1 $mavenTestArgs -Dtest=arg1 1>/some/log/dir/maven-test.txt 2>&1 </dev/null
&
 
   pid=$!
 

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepGit.approved.txt
Wed Nov 27 16:07:49 2013
@@ -57,7 +57,7 @@ cd /some/working/dir/
     fi
     if [[ -d apache-source ]] && [[ ! -d apache-source/.git ]]
     then
-      rm -rf apache-source	  
+      rm -rf apache-source
     fi
     if [[ ! -d apache-source ]]
     then
@@ -84,11 +84,11 @@ cd /some/working/dir/
   if [[ "${buildTool}" == "maven" ]]
   then
     rm -rf /some/working/dir/maven/org/apache/hive
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
     cd itests
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
   elif [[ "${buildTool}" == "ant" ]]
   then
     ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepNone.approved.txt
Wed Nov 27 16:07:49 2013
@@ -57,7 +57,7 @@ cd /some/working/dir/
     fi
     if [[ -d apache-source ]] && [[ ! -d apache-source/.git ]]
     then
-      rm -rf apache-source	  
+      rm -rf apache-source
     fi
     if [[ ! -d apache-source ]]
     then
@@ -84,11 +84,11 @@ cd /some/working/dir/
   if [[ "ant" == "maven" ]]
   then
     rm -rf /some/working/dir/maven/org/apache/hive
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
     cd itests
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
   elif [[ "ant" == "ant" ]]
   then
     ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \

Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt
URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt?rev=1546086&r1=1546085&r2=1546086&view=diff
==============================================================================
--- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt
(original)
+++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testPrepSvn.approved.txt
Wed Nov 27 16:07:49 2013
@@ -57,7 +57,7 @@ cd /some/working/dir/
     fi
     if [[ -d apache-source ]] && [[ ! -d apache-source/.git ]]
     then
-      rm -rf apache-source	  
+      rm -rf apache-source
     fi
     if [[ ! -d apache-source ]]
     then
@@ -84,11 +84,11 @@ cd /some/working/dir/
   if [[ "maven" == "maven" ]]
   then
     rm -rf /some/working/dir/maven/org/apache/hive
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
     cd itests
-    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven
-    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy
+    mvn -B clean install -DskipTests -Dmaven.repo.local=/some/working/dir/maven $mavenArgs
+    mvn -B test -Dmaven.repo.local=/some/working/dir/maven -Dtest=TestDummy $mavenArgs
   elif [[ "maven" == "ant" ]]
   then
     ant -Dant=arg1 -Divy.default.ivy.user.dir=/some/working/dir/ivy \



Mime
View raw message