-
-
Notifications
You must be signed in to change notification settings - Fork 616
Add step line in JUnit formatter #1608
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
Conversation
|
@magnetik thanks for the contribution, I agree this could be useful. However it looks to me like the Your code appears to be putting it on the It would be great if you could fix that, and update the JUnit examples in the failing tests to include the new attribute? Thanks :) |
|
oh yep my bad. I will correct it |
63732b9 to
23119e9
Compare
|
I'm fixing the test but it made me wonder if I should report the line only for failed steps because for valid steps, it will always return the last one |
23119e9 to
58fdca1
Compare
|
Hey @acoulton. Do you have any input or things I need to change? Thanks :) |
acoulton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magnetik apologies that I didn't get a chance to look at this sooner.
It looks like the junit examples in the hook_failures_junit_(annotations|attributes).feature files need to be updated to add the new attribute there as well.
The implementation looks good to me - in a perfect world I'd rather have kept the code alongside writing the other attributes (e.g. in JunitScenarioPrinter) but from a quick look I think that would be challenging with the existing structure of the listener / printer / output classes. So I think you've found a good solution to add this to what we have already.
made me wonder if I should report the line only for failed steps because for valid steps, it will always return the last one
I think that's OK, it's probably better for end-users to consistently have the attribute present with "the line number of the step that ran" than to have to work out what it means / work around it only being present sometimes.
|
It was my turn to be late to the party. I fixed both files. Thanks for your input 👍 |
acoulton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magnetik thanks very much for updating this, there's one tiny change to pass the standards check - I'll commit that for you now (once this is merged, the CI will run immediately for any future contributions from you, so it'll be much easier to get feedback).
carlos-granados
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @magnetik
Hi,
From https://github.com/testmoapp/junitxml, I've seen that the
<testcase>tag can support a line number. It can helps pinpointing a failing test quickly.Thanks !