Skip to content
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

Feature/cucumber junit report #729

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

janluak
Copy link

@janluak janluak commented Oct 25, 2024

Hi pytest-bdd team,

thanks for the great work! Totally in love with BDD and awesome it works out of the box with pytest 🎉

At our project needed a junit formatted report for the output of the bdd tests (gitlab isn't providing a native support for other pytest-bdd reports).
Since I didn't like the idea of exporting the cucumberjson and then using a third party to convert to junit-xml I simply added the support natively to pytest-bdd with this PR.
Additionally, I fixed #567 (at least for steps, not a full feature) with it.

I am not really happy with the implementation of cucumber reports → if you approve the first version here I'd provide a rewrite of the reporting which is a bit cleaner and easier to adopt the additional feature list of cucumber reports. E.g. I'd not use the json format to generate the xml - afaik the different reports have different capabilities which doesn't help converting them from one to another when having the source data available...

Anyways, happy to get feedback ;)

@youtux
Copy link
Contributor

youtux commented Oct 25, 2024

This sounds like a good feature to have.

I wonder if we should better instead create the report using the Cucumber message format, and then use functionality already implemented in https://github.com/cucumber/junit-xml-formatter/ to convert from Cucumber Message format to JUnit (maybe we can improve that repo to provide a command line interface to convert from Cucumber Message to JUnit)

@jsa34
Copy link
Collaborator

jsa34 commented Oct 25, 2024

I think using messages would help somewhat and we probably are better off investing in that route for longer term maintenance.

Having said that, the PR for messages for Python impl seems stuck: cucumber/messages#165

I wonder how to unblock/move forward...

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.

Cucumber JSON report is generated without skipped tests info
3 participants