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

add error_message for steps that have the status pending #2393

Merged
merged 2 commits into from Apr 21, 2024

Conversation

markstein
Copy link
Contributor

🤔 What's changed?

By evaluating the runs, it is sometimes helpful to see the detailed error message even for steps that are pending.

⚡️ What's your motivation?

The error message is also output for steps that have the status pending #2392

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@markstein markstein changed the title add error_message for steps that have the status pending #2392 add error_message for steps that have the status pending Apr 9, 2024
@coveralls
Copy link

coveralls commented Apr 9, 2024

Coverage Status

coverage: 98.392%. remained the same
when pulling 5935167 on markstein:main
into 5df8971 on cucumber:main.

Copy link
Contributor

@davidjgoss davidjgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to do this @markstein.

Can you give an example of user code that you would use and expect this new behaviour to kick in? Generally pending steps are signified with return 'pending' (or other equivalent) so there is not an error present, although I suppose with the callback flavour it could work - is that what you had in mind?

See also https://github.com/cucumber/cucumber-js/blob/main/features/pending_steps.feature

@davidjgoss
Copy link
Contributor

I'm also curious as to what a "detailed error message" would be in case of pending, given it is supposed to just mean the step isn't implemented yet.

@markstein
Copy link
Contributor Author

@davidjgoss thanks for taking the time for the review.

yes, we use it as a callback variant in the afterStep hook. We use the pending status partly for integration tests that are currently "unstable" due to instability in external systems. However, other sources of error could possibly arise, which would then be recognized based on the error message.

Furthermore, if you look at the Java implementation (which is not necessarily relevant), but the behavior reflects:
https://github.com/cucumber/cucumber-jvm/blob/6549826da802dbf031b89590d2cf4bbdeb36fc3c/cucumber-core/src/main/java/io/cucumber/core/plugin/JsonFormatter.java#L317
image

Based on json result, the error message is then displayed in the html report.

Copy link
Contributor

@davidjgoss davidjgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks again.

@davidjgoss davidjgoss merged commit 7f4999b into cucumber:main Apr 21, 2024
8 checks passed
@davidjgoss
Copy link
Contributor

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.

None yet

3 participants