[ 
https://issues.apache.org/jira/browse/HIVE-23460?focusedWorklogId=433659&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-433659
 ]

ASF GitHub Bot logged work on HIVE-23460:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/May/20 12:16
            Start Date: 15/May/20 12:16
    Worklog Time Spent: 10m 
      Work Description: 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 433659)
    Time Spent: 0.5h  (was: 20m)

> Add qoption to disable qtests
> -----------------------------
>
>                 Key: HIVE-23460
>                 URL: https://issues.apache.org/jira/browse/HIVE-23460
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23460.01.patch, HIVE-23460.02.patch, 
> HIVE-23460.02.patch, HIVE-23460.02.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> instead other ways to exclude them... (testconfiguration.properties; 
> CliConfig#excludeQuery)
> {code}
> --! qt:disabled:reason
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to