-
Notifications
You must be signed in to change notification settings - Fork 3
Custom junit formatting #3
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
Custom junit formatting #3
Conversation
This is applicable to Scenarios which are a part of a Scenario Outline. Each example in an outline would be appended an index to its name in the output (ex: Chekote#1, Chekote#2, Chekote#3...), but in a behat --rerun, they are all appended Chekote#1, which breaks IFT detection. Not having the Example number is the way the script currently expects the output to be, so it was removed.
7c85710 to
3e9392a
Compare
3e9392a to
818bbef
Compare
Chekote
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.
I've also asked @BKorenek to weigh in on this and confirm that his concerns about navigating have been addressed.
src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
Outdated
Show resolved
Hide resolved
src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
Outdated
Show resolved
Hide resolved
src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
Outdated
Show resolved
Hide resolved
ee05112 to
da1aa5f
Compare
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.
I'm not super familiar with how this is all set up or exactly how it would translate, but at a glance it seems like ti would be good. The title is on its own from what I can tell, so it can be copied exactly and fed into behat --name="<paste>" and in addition the file and line number are dropped on there own line, pending donalds review being address it seems, which can also be used as behat <paste>. I'm a happy camper, as long as that copy button in CI picks up just the title, or the file with line number
Updated projects that use this modification to only rely on it if the circleci environment variable is set.
src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php
Outdated
Show resolved
Hide resolved
Handle this use case in projects that use the patched version
This PRs customizes the title of a Scenario and other attributes when formatting test output using the
junitformat.It mainly adds the line number and CircleCI node number to the scenario title.
EDIT: I ended up only adding any attributes if the
CIRCLE_NODE_INDEXenv variable is set. This way, tests in this project will not have to be affected, and I updated tests that use this patched version to set that variable when the added attributes are needed.