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

Use Exception.stackTrace #26

Closed
mpkorstanje opened this issue Feb 15, 2024 · 4 comments · Fixed by #30
Closed

Use Exception.stackTrace #26

mpkorstanje opened this issue Feb 15, 2024 · 4 comments · Fixed by #30

Comments

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Feb 15, 2024

🤔 What's the problem you're trying to solve?

I would like to render stack traces nicely.

✨ What's your proposed solution?

In cucumber/messages#182 the stacktrace property was added to messages. It isn't used yet in the formatter.

⛏ Have you considered any alternatives or workarounds?

Cucumber JVM currently writes the stacktrace into the Exception.message field.

📚 Any additional context?

I'm not sure in which field of the XML the stacktrace is supposed to go. This will need some integration testing. And this should also keep working in conjunction with the html formatter.

@mpkorstanje
Copy link
Contributor Author

@davidjgoss did the use of Exception.stackTrace make it into `react-components yet?

@davidjgoss
Copy link

@mpkorstanje not yet - I'll put something together for that today.

I'm also not sure where a separate stack trace could/should go while remaining valid per the XSD. I asked the original requester in cucumber/cucumber-js#2348 (comment)

@mpkorstanje
Copy link
Contributor Author

Running Surefire (which produces JUnit XML like files) the xml should look like this:

    <failure message="expected: &lt;true&gt; but was: &lt;false&gt;" type="org.opentest4j.AssertionFailedError"><![CDATA[org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at io.cucumber.skeleton.StepDefinitions.my_belly_should_growl(StepDefinitions.java:19)
	at ✽.my belly should growl(classpath:io/cucumber/skeleton/belly.feature:6)
]]></failure>

So the stacktrace goes into the element, the exception message is the message and the type is the class of the exception.

@davidjgoss
Copy link

React components change: cucumber/react-components#345

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 a pull request may close this issue.

2 participants