Skip to content

Add scenario hook errors to first and last steps#417

Merged
vearutop merged 1 commit intomainfrom
hook-errors
Aug 8, 2021
Merged

Add scenario hook errors to first and last steps#417
vearutop merged 1 commit intomainfrom
hook-errors

Conversation

@vearutop
Copy link
Copy Markdown
Member

@vearutop vearutop commented Aug 8, 2021

Description

This PR fixes contextualized hooks introduced in #409 in the way how errors are handled.

Motivation & context

Original implementation of new hooks did not provide enough visibility to errors emitted by scenario hooks.
Test run would fail silently with all steps passed.

This PR changes errors handling to leverage closest step to communicate hook failure.

For the After scenario hook, errors are added to the last evaluated step.
For the Before scenario hook, errors are added to the first step.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Note to other contributors

No note.

Update required of cucumber.io/docs

No update.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 8, 2021

Codecov Report

Merging #417 (fb87671) into main (f1ca5dc) will increase coverage by 0.31%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #417      +/-   ##
==========================================
+ Coverage   82.75%   83.07%   +0.31%     
==========================================
  Files          26       26              
  Lines        2459     2511      +52     
==========================================
+ Hits         2035     2086      +51     
- Misses        327      328       +1     
  Partials       97       97              
Impacted Files Coverage Δ
suite.go 88.74% <84.61%> (+2.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1ca5dc...fb87671. Read the comment docs.

@vearutop vearutop marked this pull request as ready for review August 8, 2021 20:42
@vearutop vearutop merged commit 8cf3f41 into main Aug 8, 2021
@vearutop vearutop deleted the hook-errors branch August 8, 2021 20:42
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.

1 participant