-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add the JUnit time
attribute on a failed tests.
#204
base: master
Are you sure you want to change the base?
Add the JUnit time
attribute on a failed tests.
#204
Conversation
The Sonar JUnit parser fails if the time attribute is not present on failed tests. This patch adds the time attribute for these tests with a fixed duration of "0". Adding the real test duration was considered however it cannot be done easily with the current xcpretty implementation: xcpretty parses Xcode output line by line whereas a failed test outputs at least 2 lines of log: one that shows the failed test and the cause, another that displays the duration (quite the same line as a passing test). A considered approach would be to keep a context and output a transformed log line only if the context is full (in the case of failed tests, only if the cause and the duration have been parsed).
Any news on this? I'm having the same issue and made the exact same fix in my fork. |
@Palleas this will be addressed after releasing 0.3. |
Great news! |
Hello, |
you can use / test it with |
Alright, thanks @supermarin. I'll have a look. |
Um. This blocking people using xcpretty with Sonar and is a trivial change. Why can we not get a |
@orj sorry for the late feedback on this. I'm pretty sure time value is present on the test run output. I think we should parse it and add properly vs just adding a zero. Mind looking into that? |
The Sonar JUnit parser fails if the
time
attribute is not present onfailed tests. This patch adds this attribute for these tests with a
fixed duration of "0".
Adding the real test duration was considered however it cannot be
done easily with the current xcpretty implementation: xcpretty parses
Xcode output line by line whereas a failed test outputs at least 2 lines
of log: one that shows the failed test and the cause, another that
displays the duration (quite the same line as a passing test).
A considered approach would be to keep a context and output a
transformed log line only if the context is full (in the case of failed
tests, only if the cause and the duration have been parsed).