-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Junit & HTML reports - Incorrect count for failed tests when -retry-tests-on-failure
flag is passed
#217
Comments
@ssharma0312 Thank you for reporting this. |
We are also seeing this. An awesome improvement in Xcode 13. |
Any update on this bug? |
I am also seeing this issue on Xcode 13.1. Tests that passed on successive iterations are reported as failure. Very critical bug. |
Working on this bug, I will create a MR coming shortly with the fix. |
Please feel free to test by pulling from #247 Or using mint: |
With introduction of XCode 13, we can now re-run failed tests multiple times. This feature is very helpful for flaky tests.
Unlike .xcresult file, the test reports produced by XCTestHTMLReport counts re-tried tests x number of times (where x == no. of times a test is retried). This shows incorrect metrics.
In the following example I am passing flag
-retry-tests-on-failure
, so my failed test will re-run until they pass but for maxi 2 times (-test-iterations
)xcodebuild -workspace ABC.xcworkspace -scheme ABCTest -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=15.0' test -parallel-testing-enabled YES -parallel-testing-worker-count 5 -maximum-concurrent-test-simulator-destinations 5 -test-iterations 2 -retry-tests-on-failure -quiet -resultBundlePath TestResults
The .xcresult file produced, the "Failed" tab only shows 3 failed test because these 3 failed on both retries, the few tests that were failed on 1st attempt but succeed on 2nd retry are marked as Passed and counted only once, and showed under "Passed" tab. XCTestHTMLReport plugin should follow same pattern i.e. the tests that were passed on retry should not be counted as failed in HTML & Junit reports & should be counted only once.
.xcresult file
![image](https://user-images.githubusercontent.com/15973152/135531013-d52c0024-441e-448e-8dcd-66f542049167.png)
.HTML Report produced by XCTestHTMLReport
![image](https://user-images.githubusercontent.com/15973152/135531360-72036ae7-a9f1-447e-a654-2986f5e39d2a.png)
.HTML Report produced by XCTestHTMLReport
![image](https://user-images.githubusercontent.com/15973152/135531452-a4db8a2c-1e29-4213-b82e-c7d4226fda49.png)
The text was updated successfully, but these errors were encountered: