You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Jack Bearden <ja...@altiscale.com> on 2018/08/01 18:44:35 UTC

Re: Question regarding hbase-shell JRuby testing workflow

Great feedback. Thanks all

On Tue, Jul 31, 2018 at 10:59 AM, Sean Busbey <bu...@apache.org> wrote:

> check out the configs for the maven-dependency-plugin. My guess would
> be that your call to dependency:build-classpath is getting the
> artifacts needed for runtime scope and not test scope.
>
> On Mon, Jul 30, 2018 at 10:16 PM, Jack Bearden <ja...@jackbearden.com>
> wrote:
> > Hey all! I was hacking hbase-shell and JRuby over the weekend and wanted
> to
> > get some feedback on workflow. My objective was to execute a single Ruby
> > unit test in isolation from the TestShell.java class via the jruby
> binary.
> > I was able to accomplish this by doing the following steps:
> >
> > 1.  Pulled down branch-2
> > 2.  Installed and cleaned via maven at the base directory (mvn
> > -Dmaven.javadoc.skip -DskipTests install)
> > 3.  Changed to the hbase-shell directory and exported the classpath (mvn
> > dependency:build-classpath -Dmdep.outputFile=/path/to/cpath.txt)
> > 4.  Exported the path to that file to shell env (export
> > TEST_PATH="/path/to/cpath.txt")
> > 5.  Hacked tests_runner.rb to just load("path/to/test") for the test I
> > wanted to run
> > 6.  From the hbase-shell project directory ran the following:
> >
> > jruby \
> > -J-cp `cat $TEST_PATH` \
> > -d -w \
> > -I src/test/ruby \
> > -I src/main/ruby \
> > src/test/ruby/tests_runner.rb
> >
> > The problem is, is this only worked on *most* of the hbase-shell Ruby
> > tests. The only way to get, for example, list_procedures_test.rb to work
> > completely, was to run it from the TestShell.java file. When ran from the
> > jruby binary, I get a "class not found" when
> > org.apache.hadoop.hbase.client.procedure.ShellTestProcedure.new was
> being
> > referenced. I can't figure out how to load this class adhoc and not
> through
> > what appears to be Maven magic.
> >
> > Any suggestions or better ideas on how to do this?
>