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

@janluak
Copy link
Author

janluak commented Oct 28, 2024

Hi @youtux and @jsa34,

thanks for the feedback and the ref to messages.

In terms of using a separate package for changing the format I have two thoughts: one the one hand I definitely see the advantage of just being able to rely on a third party for the conversion. On the other hand this requires an additional installation of a different language which e.g. makes pipelines unnecessary big.

Yet, since messages seems to be the new standard in cucumber, (future) plugins will take care of making the generation of a separate report irrelevant for using them in CI.

With that in mind: do you want to temporarily follow up here and eventually replace the hole reporting as soon as messages come available or do you want to stress the messages implementation for an overall solution right away?

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