1 Replies Last post: Mar 12, 2012 1:34 PM by Nikita Skvortsov  
Ryan Shillington Newbie 4 posts since
Sep 5, 2002
Currently Being Moderated

Mar 9, 2012 8:25 PM

Code coverage for GWT Tests using Gradle



Is there something I need to do to custom test targets to get TeamCity to recognize them and get code coverage? 


I have my build running in TeamCity 6.5 and until I added GWT Tests, all of the code coverage stuff was working great (using the Intellij IDEA coverage runner).  When I added my first GWT test, I noticed that the coverage #s reported by TeamCity didn't improve at all.  Unfortunately TeamCity is completely ignoring my GWT tests.  


Since getting GWTTests to run in Gradle is still kind of uncharted territory, I published all of the details on how I did it here:




Note the "test.dependsOn(gwtTestCompile);" part.  When I run "gradle test" it runs all of my GWT tests first, and then the other regular tests.





Nikita Skvortsov JetBrains 261 posts since
Dec 21, 2010
Currently Being Moderated
Mar 12, 2012 3:13 PM in response to: Ryan Shillington
Re: Code coverage for GWT Tests using Gradle



Are these tests reported by TeamCity at all? I mean, can you see them in build results?




After taking closer look at your setup, I have a few comments.


First of all, to get coverage data, you will need to replace the call to ant.junit with separate task, extending Test, e.g. task gwtTest(type: Test, dependsOn: gwtTestCompile)
More information on Test task can be found here. TeamCity will detect Test task and add jvm arguments to collect coverage data.


Also, I would replace direct call to ant.javac with properly configured Compile-type task. This way you will benefit from gradle incremental builds feature.


added some ideas on build script optimizations.

More Like This

  • Retrieving data ...