Mixed Java and Ruby projects... can TC report on both tests...

Hi,

I am introducing a little ruby (via JRuby) into our codebase.

We have some ruby tests that I'd like run alongside our Java ones.

Currently, its all driven from Ant, running both sets of tests (for ruby I am doing this:

    <target name="tests-ruby" >
        <mkdir dir="./test-output/ruby/${ant.project.name}"/>

        <java classname="org.jruby.Main" >
            <classpath refid="ionplatformdevelopment.module.test.classpath"/>
            <arg line="-I../config/RaboWriter/internalmarkets ../config/RaboWriter/internalmarkets_test/depth_cacher_test.rb"/>
        </java>
    </target>



Is there a way to get TC to report on both kinds of tests?

Or should I have a separate project to run the other tests.

Thanks,
Chris
4 comments

PS We are still on TC6, although I dont see any obvious new features for this in 6.5 or 7.

0

Hi Chris.
Sorry for late reply.

You can use some formatter for your Ruby tests which will produce JUnit-like xml. And later import such report with "XML Report Processing" feature.


Another good idea to reconfigure your build configuration to use Rake-runner with specified path to JRuby interpreter. Rake-runner may automatically inject test formatters.

0

Thanks - will try that out when I am back at work in a weeks time :)

0

Hi,

Finally got some time to work on this...

Got it working via this method:

  • ran the test scripts/suite directly - not via rake (that seems to require ant or jruby.exe to be available/installed on build machine)
  • installed the gem ci_reporter which produces Ant JUnit XML from Ruby tests (local install, checked into svn)
  • Added the XML reporter build feature to my build step as mentioned and pointed it at the xml files the above step generates (so one step builds and tests java code via ant and that same ant task also runs the ruby tests).  The job results then include both Java and Ruby test results.


I didnt want to install ant/jruby onto the build machine(s) - leaving them as generic as possible.

The ant part I used is this:

       <java classname="org.jruby.Main" dir="..">
            <classpath refid="[our main app classpath, which includes jruby]"/>
            <arg line="-I./gems/gems/ci_reporter-1.7.1/lib/ -I./gems/gems/builder-3.1.0/lib/ -I../[path for ruby scripts] -I[path for ruby test scripts] [path to a ruby script that runs all tests]"/>
        </java>


Thanks,
Chris
0

Please sign in to leave a comment.