hive git commit: HIVE-19077: Handle duplicate ptests requests standing in queue at the same time (Adam Szita via Peter Vary)

2018-05-14 Thread pvary
Repository: hive
Updated Branches:
  refs/heads/master 1542c88d5 -> 7d7c18396


HIVE-19077: Handle duplicate ptests requests standing in queue at the same time 
(Adam Szita via Peter Vary)


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

Branch: refs/heads/master
Commit: 7d7c1839625b7be9846b75c373efb557d03cf3d8
Parents: 1542c88
Author: Adam Szita 
Authored: Mon May 14 10:49:36 2018 +0200
Committer: Peter Vary 
Committed: Mon May 14 10:49:36 2018 +0200

--
 dev-support/jenkins-common.sh   |   2 -
 dev-support/jenkins-execute-build.sh|   3 +-
 .../hive/ptest/api/client/JenkinsQueueUtil.java | 143 ---
 .../hive/ptest/api/client/PTestClient.java  |  11 +-
 .../org/apache/hive/ptest/execution/PTest.java  |   3 +-
 .../hive/ptest/execution/TestCheckPhase.java|  22 ++-
 .../ptest/execution/TestTestCheckPhase.java |  36 -
 .../src/test/resources/HIVE-19077.1.patch   |  14 ++
 8 files changed, 68 insertions(+), 166 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/7d7c1839/dev-support/jenkins-common.sh
--
diff --git a/dev-support/jenkins-common.sh b/dev-support/jenkins-common.sh
index 64f486f..0467d11 100644
--- a/dev-support/jenkins-common.sh
+++ b/dev-support/jenkins-common.sh
@@ -15,8 +15,6 @@
 # limitations under the License.
 
 JIRA_ROOT_URL="https://issues.apache.org;
-JENKINS_URL="https://builds.apache.org;
-JENKINS_QUEUE_QUERY="/queue/api/json?tree=items[task[name],inQueueSince,actions[parameters[name,value]],why]"
 
 fail() {
   echo "$@" 1>&2

http://git-wip-us.apache.org/repos/asf/hive/blob/7d7c1839/dev-support/jenkins-execute-build.sh
--
diff --git a/dev-support/jenkins-execute-build.sh 
b/dev-support/jenkins-execute-build.sh
index 35392dd..f660fcb 100644
--- a/dev-support/jenkins-execute-build.sh
+++ b/dev-support/jenkins-execute-build.sh
@@ -51,8 +51,7 @@ call_ptest_server() {
local 
PTEST_CLASSPATH="$PTEST_BUILD_DIR/hive/testutils/ptest2/target/hive-ptest-3.0-classes.jar:$PTEST_BUILD_DIR/hive/testutils/ptest2/target/lib/*"
 
java -cp "$PTEST_CLASSPATH" 
org.apache.hive.ptest.api.client.PTestClient --command testStart \
-   --outputDir "$PTEST_BUILD_DIR/hive/testutils/ptest2/target" 
--password "$JIRA_PASSWORD" \
-   --jenkinsQueueUrl "$JENKINS_URL$JENKINS_QUEUE_QUERY" "$@"
+   --outputDir "$PTEST_BUILD_DIR/hive/testutils/ptest2/target" 
--password "$JIRA_PASSWORD" "$@"
 }
 
 # Unpack all test results

http://git-wip-us.apache.org/repos/asf/hive/blob/7d7c1839/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
--
diff --git 
a/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
 
b/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
deleted file mode 100644
index f335164..000
--- 
a/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.hive.ptest.api.client;
-
-import java.io.IOException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.http.HttpResponse;
-import org.apache.http.StatusLine;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.util.EntityUtils;
-

hive git commit: HIVE-19077: Handle duplicate ptests requests standing in queue at the same time (Adam Szita, via Peter Vary)

2018-04-11 Thread pvary
Repository: hive
Updated Branches:
  refs/heads/master f6dbcac35 -> 7c1f01004


HIVE-19077: Handle duplicate ptests requests standing in queue at the same time 
(Adam Szita, via Peter Vary)


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

Branch: refs/heads/master
Commit: 7c1f010045db3af6fa5b805ae4f49fc9b07d5639
Parents: f6dbcac
Author: Adam Szita 
Authored: Wed Apr 11 09:45:56 2018 +0200
Committer: Peter Vary 
Committed: Wed Apr 11 09:45:56 2018 +0200

--
 dev-support/jenkins-common.sh   |   2 +
 dev-support/jenkins-execute-build.sh|   3 +-
 .../hive/ptest/api/client/JenkinsQueueUtil.java | 133 +++
 .../hive/ptest/api/client/PTestClient.java  |  15 ++-
 4 files changed, 150 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/7c1f0100/dev-support/jenkins-common.sh
--
diff --git a/dev-support/jenkins-common.sh b/dev-support/jenkins-common.sh
index 0467d11..64f486f 100644
--- a/dev-support/jenkins-common.sh
+++ b/dev-support/jenkins-common.sh
@@ -15,6 +15,8 @@
 # limitations under the License.
 
 JIRA_ROOT_URL="https://issues.apache.org;
+JENKINS_URL="https://builds.apache.org;
+JENKINS_QUEUE_QUERY="/queue/api/json?tree=items[task[name],inQueueSince,actions[parameters[name,value]],why]"
 
 fail() {
   echo "$@" 1>&2

http://git-wip-us.apache.org/repos/asf/hive/blob/7c1f0100/dev-support/jenkins-execute-build.sh
--
diff --git a/dev-support/jenkins-execute-build.sh 
b/dev-support/jenkins-execute-build.sh
index f660fcb..35392dd 100644
--- a/dev-support/jenkins-execute-build.sh
+++ b/dev-support/jenkins-execute-build.sh
@@ -51,7 +51,8 @@ call_ptest_server() {
local 
PTEST_CLASSPATH="$PTEST_BUILD_DIR/hive/testutils/ptest2/target/hive-ptest-3.0-classes.jar:$PTEST_BUILD_DIR/hive/testutils/ptest2/target/lib/*"
 
java -cp "$PTEST_CLASSPATH" 
org.apache.hive.ptest.api.client.PTestClient --command testStart \
-   --outputDir "$PTEST_BUILD_DIR/hive/testutils/ptest2/target" 
--password "$JIRA_PASSWORD" "$@"
+   --outputDir "$PTEST_BUILD_DIR/hive/testutils/ptest2/target" 
--password "$JIRA_PASSWORD" \
+   --jenkinsQueueUrl "$JENKINS_URL$JENKINS_QUEUE_QUERY" "$@"
 }
 
 # Unpack all test results

http://git-wip-us.apache.org/repos/asf/hive/blob/7c1f0100/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
--
diff --git 
a/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
 
b/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
new file mode 100644
index 000..f973781
--- /dev/null
+++ 
b/testutils/ptest2/src/main/java/org/apache/hive/ptest/api/client/JenkinsQueueUtil.java
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.hive.ptest.api.client;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.util.EntityUtils;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+
+/**
+ * Utility class for the Precommit test job queue on Jenkins
+ */
+public class JenkinsQueueUtil {
+
+  private static final String JSON_ITEMS_FIELD = "items";
+  private static final String JSON_TASK_FIELD = "task";
+  private static final String JSON_TASK_NAME_FIELD = "name";
+