You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/05/15 12:16:26 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #1018: HIVE-23460 qdisabled

kgyrtkirk commented on a change in pull request #1018:
URL: https://github.com/apache/hive/pull/1018#discussion_r425760827



##########
File path: itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDisabledHandler.java
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.hadoop.hive.ql.qoption;
+
+import org.apache.hadoop.hive.ql.QTestUtil;
+import org.junit.Assume;
+
+import com.google.common.base.Strings;
+
+/**
+ * QTest disabled directive handler
+ *
+ * Example:
+ * --! qt:disabled:reason
+ *
+ */
+public class QTestDisabledHandler implements QTestOptionHandler {
+
+  private String message;
+
+  @Override
+  public void processArguments(String arguments) {
+    message = arguments;
+    if (Strings.isNullOrEmpty(message)) {
+      throw new RuntimeException("you have to give a reason why it was ignored");
+    }
+  }
+
+  @Override
+  public void beforeTest(QTestUtil qt) throws Exception {
+    Assume.assumeTrue(message, (message == null));

Review comment:
       the assume exception also transfers the message: 
   
   http://34.66.156.144:8080/job/hive-precommit/view/change-requests/job/PR-7/122/testReport/org.apache.hadoop.hive.cli/TestAccumuloCliDriver/Testing___split_11___Archive___testCliDriver_accumulo_joins_/
   
   I don't want to add a boolean in "QTestUtil"  - because that way I would need to also pass the message...which would break to conciseness of this feature.
   
   I had to catch and ethrow those exceptions to not "fail" these tests; instead show the reason why they are ignored.
   
   The problem is that there are "catch Excpetion" stuff all over the place - they could probably placed into finally...
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org