JUnit skipped testcases shown ?

152 views
Skip to first unread message

Pere Martir

unread,
Mar 18, 2011, 1:15:23 PM3/18/11
to Jenkins Users
How should "skipped" tests be shown ?

The failed test are shown as "yellow" balls. If the test doesn't
correctly generate JUnit XML file, it's "red" balls. I expect that the
*skipped* tests to be shown as "gray" balls.

The first question is: JUnit XML format support <skipped/> element ? I
cannot find the official documentation.

Second, Jenkins/Hudson recognizes this element ?

The scenario:

My GUI-automated tests require some complicated setup procedures,
which are not very robust. Without proper setup, the "real/interesting
part" of test cannot be executed, but I don't want them to be
considered "failed/red" because the "test" is actually not be able to
be performed.

I prefer them to be shown as "gray balls", just like when a build is
aborted manually.

Pere Martir

unread,
Mar 19, 2011, 2:08:29 PM3/19/11
to Jenkins Users
py.test just fixed this issue. It generates the <skipped/> element:

<?xml version="1.0" encoding="utf-8"?>
<testsuite name="" errors="0" failures="0" skips="1" tests="0"
time="0.331" >
<testcase classname="test" name="test_foo" time="0">
<skipped type="pytest.skip" message="i am skipped.">C:\exp\test.py:
8: Skipped: i am skipped.</skipped>
</testcase>
</testsuite>

How should <skipped/> be handled in Jenkins ?

Erik Ramfelt

unread,
Mar 21, 2011, 6:51:23 AM3/21/11
to jenkins...@googlegroups.com
I would like to see that the JUnit parser would parse the content in the <skipped> tag. As of now, i dont think the maven surefire plugin wont put anything into the tag, but NUnit and pyunit (?) does and it would be nice to see those messages.

The NUnit plugin relies on the JUnit parser as im to lazy to do it properly and add a separate NUnit test result action. But I think there are other test report plugins that rely on the default JUnit parser.

regards
//Erik

Pere Martir

unread,
Mar 21, 2011, 12:51:54 PM3/21/11
to Jenkins Users
py.test has just fixed this in dev. See the related post there:

http://lists.idyll.org/pipermail/testing-in-python/2011-March/003928.html

I've just upgraded to Jenkins 1.401, and this feature has already been
included. However, there is a bug. Jenkins treats the build as
"failed" if all tests are skipped:

http://issues.jenkins-ci.org/browse/JENKINS-7970




Erik Ramfelt

unread,
Mar 25, 2011, 5:39:56 AM3/25/11
to jenkins...@googlegroups.com, Pere Martir
Does Jenkins show the message/reason why a build was skipped?

regards
//Erik

Pere Martir

unread,
Mar 25, 2011, 6:29:29 AM3/25/11
to eram...@gmail.com, jenkins...@googlegroups.com
On Fri, Mar 25, 2011 at 10:39 AM, Erik Ramfelt <eram...@gmail.com> wrote:
> Does Jenkins show the message/reason why a build was skipped?


Not yet.

http://issues.jenkins-ci.org/browse/JENKINS-8713

Reply all
Reply to author
Forward
0 new messages