Skip to content

Conversation

@lorenzodalaqua
Copy link

@lorenzodalaqua lorenzodalaqua commented Jul 5, 2022

This PRs customizes the title of a Scenario and other attributes when formatting test output using the junit format.

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_INDEX env 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.

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.
@lorenzodalaqua lorenzodalaqua force-pushed the custom-junit-formatting branch 2 times, most recently from 7c85710 to 3e9392a Compare July 5, 2022 19:42
@lorenzodalaqua lorenzodalaqua force-pushed the custom-junit-formatting branch from 3e9392a to 818bbef Compare July 5, 2022 19:44
Copy link
Owner

@Chekote Chekote left a 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.

@lorenzodalaqua lorenzodalaqua force-pushed the custom-junit-formatting branch from ee05112 to da1aa5f Compare July 5, 2022 21:06
Copy link

@BKorenek BKorenek left a 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.
@lorenzodalaqua lorenzodalaqua requested a review from Chekote July 6, 2022 00:24
@lorenzodalaqua lorenzodalaqua requested a review from Chekote July 6, 2022 15:54
Handle this use case in projects that use the patched version
@Chekote Chekote merged commit 3cf7fee into Chekote:v3.10.0-with-patches Jul 6, 2022
@lorenzodalaqua lorenzodalaqua deleted the custom-junit-formatting branch July 6, 2022 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants