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

html and message formatters are not compatible with AfterStep hooks #1433

Closed
orien opened this issue Jun 24, 2020 · 2 comments
Closed

html and message formatters are not compatible with AfterStep hooks #1433

orien opened this issue Jun 24, 2020 · 2 comments
Assignees

Comments

@orien
Copy link
Contributor

orien commented Jun 24, 2020

Describe the bug
The html and message formatters cause Cucumber to crash when an AfterStep hook is defined.

To Reproduce
Steps to reproduce the behavior:

  1. In a Cucumber 4 project

  2. Define an AfterStep hook

    AfterStep do
      # noop
    end
  3. Run cucumber --format html --out index.html

  4. See error
    No hook found for 6c61579a-e729-4d9a-988c-fa8bc282a9a4 }. Known: ["e2c27447-c655-4aae-a248-c4bb90bc7e84"] (Cucumber::Formatter::TestStepUnknownError)
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/query/hook_by_test_step.rb:16:in `hook_id'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:115:in `hook_step_to_message'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:102:in `test_step_to_message'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `block in on_test_case_ready'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `map'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `on_test_case_ready'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `each'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/configuration.rb:34:in `notify'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/broadcast_test_case_ready_event.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_around_hooks.rb:10:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_after_hooks.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_before_hooks.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_after_step_hooks.rb:10:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:18:in `block in done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `each'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/filter.rb:62:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/compiler.rb:31:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/gherkin/parser.rb:46:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core.rb:35:in `parse'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core.rb:24:in `compile'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/runtime.rb:78:in `run!'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/cli/main.rb:29:in `execute!'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/bin/cucumber:9:in `<top (required)>'
    
  5. Run cucumber --format message

  6. See error
    No hook found for 5c4f5cbb-3ebd-408f-92c8-6298854ebdf0 }. Known: ["685158b4-219c-4a64-9b8b-e9c09d769145"] (Cucumber::Formatter::TestStepUnknownError)
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/query/hook_by_test_step.rb:16:in `hook_id'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:115:in `hook_step_to_message'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:102:in `test_step_to_message'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `block in on_test_case_ready'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `map'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/formatter/message_builder.rb:94:in `on_test_case_ready'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `each'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/configuration.rb:34:in `notify'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/broadcast_test_case_ready_event.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_around_hooks.rb:10:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_after_hooks.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_before_hooks.rb:7:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/apply_after_step_hooks.rb:10:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:18:in `block in done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `each'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/filter.rb:62:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/compiler.rb:31:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core/gherkin/parser.rb:46:in `done'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core.rb:35:in `parse'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-core-7.0.0/lib/cucumber/core.rb:24:in `compile'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/runtime.rb:78:in `run!'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/lib/cucumber/cli/main.rb:29:in `execute!'
    /usr/local/bundle/ruby/gems/2.6.0/gems/cucumber-4.0.1/bin/cucumber:9:in `<top (required)>'
    

Expected behavior
Cucumber should run successfully and format output in HTML and JSON respectively.

@vincent-psarga
Copy link
Contributor

This should be fixed with the 4.1.0 release of cucumber-ruby

@orien
Copy link
Contributor Author

orien commented Jul 2, 2020

Thanks @vincent-psarga. It sure is 🎉

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

No branches or pull requests

2 participants