Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

JUnit failures are not recognized in Bitbucket Pipelines

Failures in my JUnit test results are not recognized by Bitbucket Pipelines. The results file is created via fastlane (swiftlint) and looks like this:

<?xml version="1.0" encoding="utf-8"?>
<testsuites><testsuite>
<testcase classname='Formatting Test' name='SomeSwiftFile.swift'>
<failure message='Lines should not have trailing whitespace.'>warning: Line:15 </failure>
</testcase>
</testsuite></testsuites>

 

I also tried an different example file which looks like this:

<testsuite tests="3">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>

 

It looks like that both files are recognized as junit result files but the failures are not recognized. Take a look at the Bitbucket Pipelines result:

Screenshot 2023-01-27 at 08.06.15.png

 

Any ideas whats wrong here?

1 answer

I think I figured it out, the problem is, that the xml needs the following properties:

 

<testsuite tests="3" skipped="0" failures="1" errors="0">
With this modification the junit xml is recognized correclty.
<testsuite tests="3" skipped="0" failures="1" errors="0">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events