hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1662781 - in /hive/trunk: ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java ql/src/test/templates/TestCliDriver.vm ql/src/test/templates/TestCompareCliDriver.vm
Date Fri, 27 Feb 2015 18:40:02 GMT
Author: brock
Date: Fri Feb 27 18:40:01 2015
New Revision: 1662781

URL: http://svn.apache.org/r1662781
Log:
HIVE-9793 - Remove hard coded paths from cli driver tests (Brock via Xuefu)

Modified:
    hive/trunk/ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java
    hive/trunk/ql/src/test/templates/TestCliDriver.vm
    hive/trunk/ql/src/test/templates/TestCompareCliDriver.vm

Modified: hive/trunk/ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java?rev=1662781&r1=1662780&r2=1662781&view=diff
==============================================================================
--- hive/trunk/ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java (original)
+++ hive/trunk/ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java Fri Feb 27 18:40:01 2015
@@ -452,15 +452,17 @@ public class QTestGenTask extends Task {
       if (hadoopVersion == null) {
         hadoopVersion = "";
       }
-      if (hiveConfDir == null) {
-        hiveConfDir = "";
-      }
 
       // For each of the qFiles generate the test
+      System.out.println("hiveRootDir = " + hiveRootDir);
       VelocityContext ctx = new VelocityContext();
       ctx.put("className", className);
       ctx.put("hiveRootDir", escapePath(hiveRootDir.getCanonicalPath()));
-      ctx.put("queryDir", relativePath(hiveRootDir, queryDir));
+      System.out.println("hiveRootDir = " + hiveRootDir);
+      System.out.println("queryDir = " + queryDir);
+      String strQueryDir = relativePath(hiveRootDir, queryDir);
+      System.out.println("queryDir = " + strQueryDir);
+      ctx.put("queryDir", strQueryDir);
       ctx.put("qfiles", qFiles);
       ctx.put("qfilesMap", qFilesMap);
       if (resultsDir != null) {
@@ -468,7 +470,17 @@ public class QTestGenTask extends Task {
       }
       ctx.put("logDir", relativePath(hiveRootDir, logDir));
       ctx.put("clusterMode", clusterMode);
-      ctx.put("hiveConfDir", escapePath(hiveConfDir));
+      if (hiveConfDir == null || hiveConfDir.isEmpty()) {
+        ctx.put("hiveConfDir", "");
+      } else {
+        System.out.println("hiveConfDir = " + hiveConfDir);
+        hiveConfDir = relativePath(hiveRootDir, new File(hiveConfDir));
+        System.out.println("hiveConfDir = " + hiveConfDir);
+        if (!(new File(hiveRootDir, hiveConfDir)).isDirectory()) {
+          throw new BuildException("hiveConfDir is not dir " + new File(hiveRootDir, hiveConfDir));
+        }
+        ctx.put("hiveConfDir", hiveConfDir);
+      }
       ctx.put("hadoopVersion", hadoopVersion);
       ctx.put("initScript", initScript);
       ctx.put("cleanupScript", cleanupScript);

Modified: hive/trunk/ql/src/test/templates/TestCliDriver.vm
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/templates/TestCliDriver.vm?rev=1662781&r1=1662780&r2=1662781&view=diff
==============================================================================
--- hive/trunk/ql/src/test/templates/TestCliDriver.vm (original)
+++ hive/trunk/ql/src/test/templates/TestCliDriver.vm Fri Feb 27 18:40:01 2015
@@ -41,6 +41,9 @@ public class $className extends TestCase
     String cleanupScript = "$cleanupScript";
     try {
       String hadoopVer = "$hadoopVersion";
+      if (!hiveConfDir.isEmpty()) {
+        hiveConfDir = HIVE_ROOT + hiveConfDir;
+      }
       qt = new QTestUtil((HIVE_ROOT + "$resultsDir"), (HIVE_ROOT + "$logDir"), miniMR,
       hiveConfDir, hadoopVer, initScript, cleanupScript);
 

Modified: hive/trunk/ql/src/test/templates/TestCompareCliDriver.vm
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/templates/TestCompareCliDriver.vm?rev=1662781&r1=1662780&r2=1662781&view=diff
==============================================================================
--- hive/trunk/ql/src/test/templates/TestCompareCliDriver.vm (original)
+++ hive/trunk/ql/src/test/templates/TestCompareCliDriver.vm Fri Feb 27 18:40:01 2015
@@ -42,6 +42,9 @@ public class $className extends TestCase
     String cleanupScript = "$cleanupScript";
     try {
       String hadoopVer = "$hadoopVersion";
+      if (!hiveConfDir.isEmpty()) {
+        hiveConfDir = HIVE_ROOT + hiveConfDir;
+      }
       qt = new QTestUtil((HIVE_ROOT + "$resultsDir"), (HIVE_ROOT + "$logDir"), miniMR,
       hiveConfDir, hadoopVer, initScript, cleanupScript);
 



Mime
View raw message