Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

double unit test reporting with hudson and maven

I have a maven2 project in hudson and when the cobertura reporting plugin runs, it causes the unit tests to show that they have run twice. I don't mind them running multiple times, but the trend graph shows twice as many tests as we actually are running. Is there a way to make sure the graph only shows them once?

thanks,

Jeff

like image 318
Jeff Storey Avatar asked Jul 08 '09 14:07

Jeff Storey


2 Answers

This is a known bug. Just wait for it to be fixed.

like image 84
kazanaki Avatar answered Sep 28 '22 02:09

kazanaki


The workaround I use (works in Hudson 1.391) is to configure cobertura in separate Maven profile and run it in a Hudson job as a post-build step.

Mode detailed instructions:

  1. Add cobertura to your project pom in a special profile (so it won't run while default lifecycle) and configure it to create report in xml format.
  2. Install "Hudson M2 Extra Steps Plugin"
  3. Configure your Hudson job as Maven 2 project
  4. In your job configuration in the "Build" section configure usual clean/install goals
  5. In "Build Environment" section select "Configure M2 Extra Build Steps" and add Maven post-build step. Configure it to run "cobertura:cobertura -P your_cobertura_profile_name"
  6. In "Post-build Actions" select "Publish Cobertura Coverage Report" and configure proper xml report pattern (default should work just fine)
like image 43
Boris Kirzner Avatar answered Sep 28 '22 02:09

Boris Kirzner