Custom junit formatting#3
Merged
Chekote merged 13 commits intoChekote:v3.10.0-with-patchesfrom Jul 6, 2022
Merged
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
requested changes
Jul 5, 2022
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
BKorenek
approved these changes
Jul 5, 2022
There was a problem hiding this comment.
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.
Chekote
reviewed
Jul 6, 2022
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
Chekote
approved these changes
Jul 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.