You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2014/09/02 08:05:36 UTC

svn commit: r1621922 - in /pig/trunk: ./ test/ test/org/apache/pig/backend/hadoop/accumulo/ test/org/apache/pig/builtin/ test/org/apache/pig/test/

Author: daijy
Date: Tue Sep  2 06:05:35 2014
New Revision: 1621922

URL: http://svn.apache.org/r1621922
Log:
PIG-4145: Port local mode tests to Tez - part1

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/test/org/apache/pig/backend/hadoop/accumulo/TestAccumuloPigCluster.java
    pig/trunk/test/org/apache/pig/builtin/TestBigTypeSort.java
    pig/trunk/test/org/apache/pig/builtin/TestCurrentTime.java
    pig/trunk/test/org/apache/pig/builtin/TestInvokerGenerator.java
    pig/trunk/test/org/apache/pig/test/Util.java
    pig/trunk/test/tez-tests

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Sep  2 06:05:35 2014
@@ -66,6 +66,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-4145: Port local mode tests to Tez - part1 (daijy)
+
 PIG-4076: Fix pom file (daijy)
 
 PIG-4140: VertexManagerEvent.getUserPayload returns ReadOnlyBuffer after TEZ-1449 (daijy)

Modified: pig/trunk/test/org/apache/pig/backend/hadoop/accumulo/TestAccumuloPigCluster.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/backend/hadoop/accumulo/TestAccumuloPigCluster.java?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/backend/hadoop/accumulo/TestAccumuloPigCluster.java (original)
+++ pig/trunk/test/org/apache/pig/backend/hadoop/accumulo/TestAccumuloPigCluster.java Tue Sep  2 06:05:35 2014
@@ -33,12 +33,10 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.commons.io.FileUtils;
-import org.apache.hadoop.conf.Configuration;
 import org.apache.log4j.Logger;
-import org.apache.pig.ExecType;
 import org.apache.pig.PigServer;
 import org.apache.pig.data.Tuple;
-import org.apache.pig.test.MiniCluster;
+import org.apache.pig.test.Util;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Before;
@@ -89,7 +87,7 @@ public class TestAccumuloPigCluster {
 
     @Before
     public void beforeTest() throws Exception {
-        pig = new PigServer(ExecType.LOCAL);
+        pig = new PigServer(Util.getLocalTestMode());
     }
 
     @AfterClass

Modified: pig/trunk/test/org/apache/pig/builtin/TestBigTypeSort.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/builtin/TestBigTypeSort.java?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/builtin/TestBigTypeSort.java (original)
+++ pig/trunk/test/org/apache/pig/builtin/TestBigTypeSort.java Tue Sep  2 06:05:35 2014
@@ -28,10 +28,10 @@ import java.math.BigInteger;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.pig.ExecType;
 import org.apache.pig.PigServer;
 import org.apache.pig.builtin.mock.Storage.Data;
 import org.apache.pig.data.Tuple;
+import org.apache.pig.test.Util;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -42,7 +42,7 @@ public class TestBigTypeSort {
 
 	@Before
 	public void setUp() throws Exception {
-		pigServer = new PigServer(ExecType.LOCAL);
+		pigServer = new PigServer(Util.getLocalTestMode());
 	}
 
 	@Test

Modified: pig/trunk/test/org/apache/pig/builtin/TestCurrentTime.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/builtin/TestCurrentTime.java?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/builtin/TestCurrentTime.java (original)
+++ pig/trunk/test/org/apache/pig/builtin/TestCurrentTime.java Tue Sep  2 06:05:35 2014
@@ -26,12 +26,10 @@ import static org.junit.Assert.assertTru
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.pig.ExecType;
 import org.apache.pig.PigServer;
-import org.apache.pig.backend.executionengine.ExecException;
 import org.apache.pig.builtin.mock.Storage.Data;
 import org.apache.pig.data.Tuple;
-import org.apache.pig.impl.util.UDFContext;
+import org.apache.pig.test.Util;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -42,7 +40,7 @@ public class TestCurrentTime {
 
     @Before
     public void setUp() throws Exception {
-        pigServer = new PigServer(ExecType.LOCAL);
+        pigServer = new PigServer(Util.getLocalTestMode());
     }
 
     @Test

Modified: pig/trunk/test/org/apache/pig/builtin/TestInvokerGenerator.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/builtin/TestInvokerGenerator.java?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/builtin/TestInvokerGenerator.java (original)
+++ pig/trunk/test/org/apache/pig/builtin/TestInvokerGenerator.java Tue Sep  2 06:05:35 2014
@@ -26,11 +26,11 @@ import java.util.List;
 import java.util.Random;
 import java.util.Set;
 
-import org.apache.pig.ExecType;
 import org.apache.pig.PigServer;
 import org.apache.pig.builtin.mock.Storage.Data;
 import org.apache.pig.data.Tuple;
 import org.apache.pig.impl.util.Utils;
+import org.apache.pig.test.Util;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -43,7 +43,7 @@ public class TestInvokerGenerator {
 
     @Before
     public void setUp() throws Exception {
-        pigServer = new PigServer(ExecType.LOCAL);
+        pigServer = new PigServer(Util.getLocalTestMode());
         r = new Random(42L);
     }
 

Modified: pig/trunk/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/Util.java?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/Util.java (original)
+++ pig/trunk/test/org/apache/pig/test/Util.java Tue Sep  2 06:05:35 2014
@@ -58,6 +58,7 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.SimpleLayout;
 import org.apache.pig.ExecType;
+import org.apache.pig.ExecTypeProvider;
 import org.apache.pig.LoadCaster;
 import org.apache.pig.PigException;
 import org.apache.pig.PigServer;
@@ -735,7 +736,7 @@ public class Util {
         }
         if (context.getExecType() == ExecType.MAPREDUCE || context.getExecType().name().equals("TEZ")) {
             return FileLocalizer.hadoopify(filename, context);
-        } else if (context.getExecType() == ExecType.LOCAL) {
+        } else if (context.getExecType().isLocal()) {
             return filename;
         } else {
             throw new IllegalStateException("ExecType: " + context.getExecType());
@@ -1346,4 +1347,13 @@ public class Util {
         }
         return jarNames[0];
     }
+
+    public static ExecType getLocalTestMode() throws Exception {
+        String execType = System.getProperty("test.exec.type");
+        if (execType!=null && execType.equals("tez")) {
+            return ExecTypeProvider.fromString("tez_local");
+        } else {
+            return ExecTypeProvider.fromString("local");
+        }
+    }
 }

Modified: pig/trunk/test/tez-tests
URL: http://svn.apache.org/viewvc/pig/trunk/test/tez-tests?rev=1621922&r1=1621921&r2=1621922&view=diff
==============================================================================
--- pig/trunk/test/tez-tests (original)
+++ pig/trunk/test/tez-tests Tue Sep  2 06:05:35 2014
@@ -61,3 +61,7 @@
 **/TestTezCompiler.java
 **/TestTezJobControlCompiler.java
 **/TestTezLauncher.java
+**/TestAccumuloPigCluster.java
+**/TestBigTypeSort.java
+**/TestCurrentTime.java
+**/TestInvokerGenerator.java