Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # dev - Getting e2e test to work with JRuby -- how do I get it to see a library?


Copy link to this message
-
Re: Getting e2e test to work with JRuby -- how do I get it to see a library?
Daniel Dai 2012-02-24, 23:11
Current directory for e2e tests is test/e2e/pig/testdist. All the
script file in test/e2e/pig/udfs/ruby should copy to libexec/ruby (we
might need to change test/e2e/pig/build.xml if it does not copy). I am
not familiar with ruby, but can you require "libexec/ruby/pigudf"?

Daniel

On Fri, Feb 24, 2012 at 3:03 PM, Jonathan Coveney <[EMAIL PROTECTED]> wrote:
> Ah, ok, I think there was a misunderstanding. I do not have any difficulty
> getting the e2e tests to run, or to see the ruby scripts...
>
> The issue is that the ruby scripts have to require a library ("require
> 'pigudf'"), and there is no way to get that file where they can see them.
> Since the tests are not run from the same directory where the udf's are,
> when you do the require, it looks in that directory and doesn't find
> it...but there's no way to ship it to that directly.
>
> 2012/2/24 Jonathan Coveney <[EMAIL PROTECTED]>
>
>> Thanks Daniel!
>>
>>
>> 2012/2/24 Daniel Dai <[EMAIL PROTECTED]>
>>
>>> Hi, Jonathan,
>>> This should similar to python UDF. Take a look of Scripting tests in
>>> nightly.conf. We use SCRIPTHOMEPATH to find python udf which is
>>> located in test/e2e/pig/udfs/python. You can create a directory
>>> test/e2e/pig/ruby to include ruby udfs.
>>>
>>> Thanks,
>>> Daniel
>>>
>>> On Thu, Feb 23, 2012 at 4:17 PM, Jonathan Coveney <[EMAIL PROTECTED]>
>>> wrote:
>>> > I'm getting an error when running the following:
>>> >
>>> > ant -Dharness.hadoop.home=. -Dharness.old.pig=. -Dtests.to.run="-t
>>> > RubyUDFs_1" test-e2e-local
>>> >
>>> > The error is that the ruby scripts can't find pigudf.rb, which is the
>>> > library they need to function. But I am not sure how to make this happen
>>> > within the e2e framework. It seems like the tests are being run from
>>> > test/e2e/pig/testdist/, but I'm not sure. There doesn't seem to be a
>>> way to
>>> > put the file in the paths' way, though. Either way, I'm curious what the
>>> > best way within the framework to make a resource file available is.
>>> >
>>> > Thanks
>>>
>>
>>