You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by Mathieu Poumeyrol <po...@idm.fr> on 2008/04/21 10:32:12 UTC

Local and MapReduce Test modes

All,

During my — not finished yet — struggle with the "using" clause for  
the order operator, I found out that the tests for the order clause  
where only run in MapReduce mode, not in local mode. I proposed a  
patch to fix this test, but Pi rightly suggest that we look for a more  
global approach to run the tests systematically in both modes. Indeed,  
I think I have read somewhere that the new (and very exciting)  
"illustrate" operator is only tested and only work in local mode — for  
now.

We could have an abstract test class responsible for PigContext setup  
and teardown (local mode or MiniCluster based). All (or most of) the  
unit tests would inherit from it. The ant script could run the test  
suite twice passing some property to the abstract class to define  
which PigContext version should be used. Some tests may still want to  
"skip" one of the two modes, but at least running test in two modes  
would become the default and natural behavior.

What do you think ?

-- 
Mathieu Poumeyrol — IDM

Re: Local and MapReduce Test modes

Posted by Alan Gates <ga...@yahoo-inc.com>.
+1

We definitely need to be testing in both modes.  As you note, we need 
some way for a test to indicate it is only appropriate to run it in one 
mode or the other.  We also should define ant targets so that developers 
can run just local or just mapreduce.

Alan.

P.S. The illustrate command now works in mapreduce mode too.

Mathieu Poumeyrol wrote:
> All,
>
> During my — not finished yet — struggle with the "using" clause for 
> the order operator, I found out that the tests for the order clause 
> where only run in MapReduce mode, not in local mode. I proposed a 
> patch to fix this test, but Pi rightly suggest that we look for a more 
> global approach to run the tests systematically in both modes. Indeed, 
> I think I have read somewhere that the new (and very exciting) 
> "illustrate" operator is only tested and only work in local mode — for 
> now.
>
> We could have an abstract test class responsible for PigContext setup 
> and teardown (local mode or MiniCluster based). All (or most of) the 
> unit tests would inherit from it. The ant script could run the test 
> suite twice passing some property to the abstract class to define 
> which PigContext version should be used. Some tests may still want to 
> "skip" one of the two modes, but at least running test in two modes 
> would become the default and natural behavior.
>
> What do you think ?
>

RE: Local and MapReduce Test modes

Posted by Olga Natkovich <ol...@yahoo-inc.com>.
Mathieu,

Sounds reasonable. Can we move this discussion to JIRA?

Olga 

> -----Original Message-----
> From: Mathieu Poumeyrol [mailto:poumeyrol@idm.fr] 
> Sent: Thursday, April 24, 2008 7:08 AM
> To: pig-dev@incubator.apache.org
> Subject: Re: Local and MapReduce Test modes
> 
> All,
> 
> Here is a simple proposal.
> 
> ant test runs twice the junit target, with two different 
> values for the property ${test.exectype}. ant test-local runs 
> all tests locally, ant-test-mapreduce runs them on the minicluster.
> 
> logs are produced in two different subdirectories of 
> build/test : logs- mapreduce and logs-local to avoid confusion.
> 
> PigTestCase implements junit's TestCase, and is responsible 
> for PigServer setup. All current TestCase will have to extend 
> PigTestCase instead of TestCase. They can test this.execType 
> to skip some test method.
> 
> This proposal hardcodes the fact that pig supports two 
> backends in PigTestCase and build.xml, but adding a new 
> backend does not require to change the actual tests. Good 
> enough for now in my opinion.
> 
> The patch contains PigTestCase, changes to build.xml and 
> TestAlgebraicEval as an example of what has to be done to the 
> actual TestCases.
> 
> -- 
> Mathieu
> 

Re: Local and MapReduce Test modes

Posted by Mathieu Poumeyrol <po...@idm.fr>.
All,

Here is a simple proposal.

ant test runs twice the junit target, with two different values for  
the property ${test.exectype}. ant test-local runs all tests locally,  
ant-test-mapreduce runs them on the minicluster.

logs are produced in two different subdirectories of build/test : logs- 
mapreduce and logs-local to avoid confusion.

PigTestCase implements junit's TestCase, and is responsible for  
PigServer setup. All current TestCase will have to extend PigTestCase  
instead of TestCase. They can test this.execType to skip some test  
method.

This proposal hardcodes the fact that pig supports two backends in  
PigTestCase and build.xml, but adding a new backend does not require  
to change the actual tests. Good enough for now in my opinion.

The patch contains PigTestCase, changes to build.xml and  
TestAlgebraicEval as an example of what has to be done to the actual  
TestCases.

-- 
Mathieu

Re: Local and MapReduce Test modes

Posted by pi song <pi...@gmail.com>.
Conceptually, we should test almost everything on both local engine and map
reduce engine. I usually found that 1) sometimes output from local is
different from map reduce engine  2) some problems only exist in one of
them. As Mathieu suggested, we should build a testing utility to help us
test both backends (or more in the future) without duplicating the code. I
don't have any solution for this yet. Anyone has a good idea?

Pi

On Mon, Apr 21, 2008 at 6:32 PM, Mathieu Poumeyrol <po...@idm.fr> wrote:

> All,
>
> During my — not finished yet — struggle with the "using" clause for the
> order operator, I found out that the tests for the order clause where only
> run in MapReduce mode, not in local mode. I proposed a patch to fix this
> test, but Pi rightly suggest that we look for a more global approach to run
> the tests systematically in both modes. Indeed, I think I have read
> somewhere that the new (and very exciting) "illustrate" operator is only
> tested and only work in local mode — for now.
>
> We could have an abstract test class responsible for PigContext setup and
> teardown (local mode or MiniCluster based). All (or most of) the unit tests
> would inherit from it. The ant script could run the test suite twice passing
> some property to the abstract class to define which PigContext version
> should be used. Some tests may still want to "skip" one of the two modes,
> but at least running test in two modes would become the default and natural
> behavior.
>
> What do you think ?
>
> --
> Mathieu Poumeyrol — IDM