You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by bi...@apache.org on 2014/09/29 02:35:40 UTC

[34/50] [abbrv] git commit: TEZ-1554. Failing tests in TestMRHelpers related to environment on Windows (Prakash Ramachandran via bikas)

TEZ-1554. Failing tests in TestMRHelpers related to environment on Windows (Prakash Ramachandran via bikas)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/55ae1e57
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/55ae1e57
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/55ae1e57

Branch: refs/heads/branch-0.5
Commit: 55ae1e57cc4a3311791e4818782787a3b5d3fd18
Parents: 09bd44e
Author: Bikas Saha <bi...@apache.org>
Authored: Sun Sep 21 22:20:55 2014 -0700
Committer: Bikas Saha <bi...@apache.org>
Committed: Sun Sep 21 22:20:55 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../tez/mapreduce/hadoop/TestMRHelpers.java     | 20 +++++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/55ae1e57/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 53409fb..6fe7ff0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -52,6 +52,7 @@ ALL CHANGES
   TEZ-1599. TezClient.preWarm() is not enabled
   TEZ-1550. TestEnvironmentUpdateUtils.testMultipleUpdateEnvironment fails on
   Windows
+  TEZ-1554. Failing tests in TestMRHelpers related to environment on Windows
 
 Release 0.5.0: 2014-09-03
 

http://git-wip-us.apache.org/repos/asf/tez/blob/55ae1e57/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRHelpers.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRHelpers.java b/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRHelpers.java
index a405cba..27f1863 100644
--- a/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRHelpers.java
+++ b/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRHelpers.java
@@ -25,6 +25,7 @@ import java.util.Map;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapreduce.MRJobConfig;
+import org.apache.hadoop.util.Shell;
 import org.apache.hadoop.yarn.api.ApplicationConstants.Environment;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.tez.dag.api.TezConstants;
@@ -113,7 +114,11 @@ public class TestMRHelpers {
     conf.set(MRJobConfig.REDUCE_ENV, "foo=red1,bar=red2");
     conf.set(MRJobConfig.MAP_LOG_LEVEL, "TRACE");
     conf.set(MRJobConfig.REDUCE_LOG_LEVEL, "FATAL");
-    conf.set(MRJobConfig.MAPRED_ADMIN_USER_ENV, "LD_LIBRARY_PATH=$TEZ_ADMIN_ENV_TEST/lib/native");
+    final String mapredAdminUserEnv = Shell.WINDOWS ?
+        "PATH=%PATH%" + File.pathSeparator + "%TEZ_ADMIN_ENV%\\bin":
+        "LD_LIBRARY_PATH=$TEZ_ADMIN_ENV_TEST/lib/native";
+
+    conf.set(MRJobConfig.MAPRED_ADMIN_USER_ENV, mapredAdminUserEnv);
     return conf;
   }
 
@@ -123,8 +128,17 @@ public class TestMRHelpers {
     Assert.assertTrue(env.containsKey(Environment.LD_LIBRARY_PATH.name()));
     Assert.assertTrue(env.containsKey(Environment.SHELL.name()));
     Assert.assertTrue(env.containsKey("HADOOP_ROOT_LOGGER"));
-    Assert.assertEquals("$PWD:$TEZ_ADMIN_ENV_TEST/lib/native",
-        env.get(Environment.LD_LIBRARY_PATH.name()));
+
+    /* On non-windows platform ensure that LD_LIBRARY_PATH is being set and PWD is present.
+     * on windows platform LD_LIBRARY_PATH is not applicable. check the PATH is being appended
+     * by the user setting (ex user may set HADOOP_HOME\\bin.
+     */
+    if (!Shell.WINDOWS) {
+      Assert.assertEquals("$PWD:$TEZ_ADMIN_ENV_TEST/lib/native",
+          env.get(Environment.LD_LIBRARY_PATH.name()));
+    } else {
+      Assert.assertTrue(env.get(Environment.PATH.name()).contains(";%TEZ_ADMIN_ENV%\\bin"));
+    }
 
 //    TEZ-273 will reinstate this or similar. 
 //    for (String val : YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH) {