-
-
Notifications
You must be signed in to change notification settings - Fork 18
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 global hooks, global attachments, hook types #102
Conversation
A bit of a chicken and egg problem with the perl tests here - they rely on the current published version of the CCK, whose messages don't include the new field, which is causing the failure. Any thoughts on how to address this @ehuelsmann? |
@ciaranmcnulty looks like the acceptance tests against the CCK are not invoked for PHP:
|
@davidjgoss looking at the test I think we can change them a little so. So instead of comparing the round trip Though I think it would be even better to include a |
05b41ff
to
773087f
Compare
# Conflicts: # dotnet/Cucumber.Messages.Specs/NdjsonStreamSerializationTests.cs
# Conflicts: # CHANGELOG.md # dotnet/Cucumber.Messages/generated/Attachment.cs # dotnet/Cucumber.Messages/generated/Envelope.cs # dotnet/Cucumber.Messages/generated/TestCase.cs # dotnet/Cucumber.Messages/generated/TestRunFinished.cs
# Conflicts: # CHANGELOG.md
I originally added Any thoughts? We could move forward with this change without making a decision on test cases, but it would be nice to capture as much as we can of the "test runs have an identity" thing at the same time. (Somewhat related to cucumber/compatibility-kit#112.) |
No thoughts yet.
I think this would a more correct solution than adding it to the https://github.com/cucumber/messages/blob/main/messages.png |
Is there another existing way to know which test cases are in which test run, before it starts? I'm thinking of a system to shard a large test suite across different execution nodes, where you'd have filtered the test cases into groups for distribution. In that situation you'd want to be able to associate the compiled test case with the test run. Getting that information up-front would mean you knew how many results you were waiting for, could show a progress bar etc. |
You're right @mattwynne, and this is how the progress bar formatter in cucumber-js works, sharded or not. So yeah the link to the run does have to be at |
🤔 What's changed?
id
toTestRunStarted
so that the corresponding finish event can be tied back to it, and attachments (from test run level hooks)TestStepResult
into its own file since it's now reused⚡️ What's your motivation?
Fixes #66 - we want to represent global hooks in the messages, because currently if they fail (thus causing the test run to fail) they aren't visible in reporting.
TestRunHookStarted
has a unique id like many other "started" messages, so we can represent multiple executions of the same hook in the same test run - this would happen a) in cucumber-js where global hooks run on each worker in a parallel configuration and b) in dotnet where global hooks run per-feature.Putting an
id
onTestRunStarted
is an approach we've discussed before and roughly agreed on in the context of global attachments per cucumber/cucumber-js#1394 (comment) - this PR doesn't address the attachments problem directly, but does lay the groundwork for it, and also means it starts to look more possible to have multiple test runs in the same stream of messages and be able to differentiate them. Note that Gherkin messages and support code aren't linked to a test run because they can be reused.Also fixes #72 by adding a type enum to
Hook
messages (including types for test run hooks).🏷️ What kind of change is this?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.