How does TeamCity pick up JUnit results

Hi,

Sorry if this is an obvious question, but I couldn't tell from the documentation, if the path to the JUnit test results needs to be given to teamcity or if it can detect junit results. How does this work?

Omair

9 comments

Hello,

TeamCity has the feature of reporting tests results on-the-fly. That is, you do not have to wait till the build end to know what tests have passed and what failed.

So, we do not parse the test framework reports, but try to plug-in into the tests running process and listen for test events, then report them to the TeamCity server. Currently, we support tests run by junit and testng tasks in Ant scripts and tests that are run by TeamCity itself in the Ipr runner.

For Maven we support tests run by Surefire plugin, but in this case we do parse the reports.

Are your JUnit tests reported by TeamCity? If not, what runner do you use and is your build script is special in some way?

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Hello Yarko,

I have a ANT build runner.
And in my build script i have junit task which tests the classes and give reports in text files/xml in a specified directory(suppose c:/ test/) .
Now while creating build configuration in TeamCity, i select build runner as ANT.
Now how teamCity will get the result of junit task of ant (results given in text/xml file)??
should i set the path of the text / xml files in the "Artifact path" in build runner configuration???
OR TeamCity will handle the test result automatically while running the ant script(as well as junit task)??

Thanks.

nb

0

Hello,

TeamCity should automatically pick up your tests while build is running, no
additional configuration is required.

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"noel baidya" <bd_noel@yahoo.com> wrote in message
news:33081860.1204199280053.JavaMail.itn@is.intellij.net...

Hello Yarko,

>

I have a ANT build runner.
And in my build script i have junit task which tests the classes and give
reports in text files/xml in a specified directory(suppose c:/ test/) .
Now while creating build configuration in TeamCity, i select build runner
as ANT.
Now how teamCity will get the result of junit task of ant (results given
in text/xml file)??
should i set the path of the text / xml files in the "Artifact path" in
build runner configuration???
OR TeamCity will handle the test result automatically while running the
ant script(as well as junit task)??

>

Thanks.

>

nb



0

I have a Maven2 build which is generating surefire-report output for JUnit tests. Can I make those reports available for viewing in TeamCity? If so, how?

0

Peter,

You can setup a custom report. Please read more about this at
http://www.jetbrains.net/confluence/x/C3M

You'll have to specify directory with surefire report as TeamCity artifact and configure an additional tab for TeamCity UI.

Hope this helps,
KIR

0

Hello

I have an Eclipse RCP project that is build and tested with Ant and TeamCity.
My Problem is the following: Since I use the Eclipse testframework the Junit Results are not passed to TeamCity.
Right now I handled it with the teamcity-info.xml, I use XSLT to convert my JUnit report to something like this:

Tests passed: 3 Tests failed: 0 Then I use the main-config.xml to attach a "JUnit Tests" tab including my html transformed test result: ]]>

Well is there a better solution for this setup? Can TeamCity by itself parse my JUnit Report?

Thanks for any Information
Flavio

0

Hello,

Currently it can't do that, but we have plans to implement such
functionality. Feel free to submit a feature request to our tracker.

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Flavio Donze" <fdo@scodi.ch> wrote in message
news:20889903.1204880721546.JavaMail.itn@is.intellij.net...

Hello

>

I have an Eclipse RCP project that is build and tested with Ant and
TeamCity.
My Problem is the following: Since I use the Eclipse testframework the
Junit Results are not passed to TeamCity.
Right now I handled it with the teamcity-info.xml, I use XSLT to convert
my JUnit report to something like this:

>

<?xml version="1.0" encoding="UTF-8"?>
<build>
<statusInfo status="SUCCESS">
<text action="append">Tests passed: 3</text>
<text action="append">Tests failed: 0</text>
</statusInfo>
<statisticValue key="testCount" value="3"/>
<statisticValue key="testsFailed" value="0"/>
<statisticValue key="testsPassed" value="3"/>
<statisticValue key="timeCount" value="0.016"/>
<statisticValue key="successRate" value="1"/>
</build>

>

Then I use the main-config.xml to attach a "JUnit Tests" tab including my
html transformed test result:
<report-tab title="Junit Tests" basePath="report/" startPage="index.html"
/>

>

Well is there a better solution for this setup? Can TeamCity by itself
parse my JUnit Report?

>

Thanks for any Information
Flavio



0

I have a similar problem where teamcity does not report my test results.  This is only on 2 of the 14 build agents I have.
All 16 build agents share the same build configuration.  What am I missing?  I see that the tests are running in that agents build log but only get a success on the UI
of team city.  Any help would be good..

0

I have a build configuration using maven to build jars.  How can I use those jars in other build configurations, run JUnit tests, and have TeamCity pick them up?  I'm currently using the command line runner, but I don't know how to (and don't think I should have to) use ant or surefire to do this without creating and maintaining another file outside TeamCity.

0

Please sign in to leave a comment.