Skip to content

Generate test_case_started/finished messages at the source#331

Open
brasmusson wants to merge 4 commits into
mainfrom
feature/emit_messages_at_source
Open

Generate test_case_started/finished messages at the source#331
brasmusson wants to merge 4 commits into
mainfrom
feature/emit_messages_at_source

Conversation

@brasmusson

@brasmusson brasmusson commented May 31, 2026

Copy link
Copy Markdown
Contributor

Description

Generating messages at the source means that the Runner shall generate test_case_started/finished and test_step_started/finished (at least)

Type of change

Please delete options that are not relevant.

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

Please add an entry to the relevant section of CHANGELOG.md as part of this pull request.

Note to other contributors

If your change may impact future contributors, explain it here, and remember to update README.md and CONTRIBUTING.md accordingly.

Checklist:

Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.

  • Tests have been added for any changes to behaviour of the code
  • New and existing tests are passing locally and on CI
  • bundle exec rubocop reports no offenses
  • CHANGELOG.md has been updated

@luke-hill

Copy link
Copy Markdown
Contributor

I get the premise of this, but there's a few questions I have regarding how this is used as on first inspection some of these ivars won't change

@brasmusson brasmusson marked this pull request as ready for review June 14, 2026 16:39
@brasmusson

Copy link
Copy Markdown
Contributor Author

Code wise this pull request is read - the TestCaseStarted/Finished messages and TestStepStarted/Finished messages are emitted by the runner. The runner_spec have not been updated to verify the sending of the messages.
Some complication with this change is that

  • the TestCaseFinished message says whether the test case will be retried or not
  • the TestStepFinished message uses the BacktraceFilter in case of exception stack traces

The decision to retry or not is handled outside the runner (outside cucumber-ruby-core), and the BacktraceFilter is defined in Cucumber::Formatter in cucumber-ruby. To avoid direct dependencies to cucumber-ruby, the runner have two new arguments so the relevant information can be passed in.

Probably the snippets message should also be emitted by the runner in relation to the TestStepFinishded message, but the generation of the snippets are also handled outside cucumber-ruby-core, so maybe it is the undefined action created from the step matching that should carry snippet data so it can be extracted by the runner.

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.

2 participants