-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
messages: extend javascript message type with workerId #2033
Conversation
The file you have updated is an automatically generated file. Your changes won't be kept. In order to make changes to the messages protocol you need to update the json schemas, then regenerate the code Also, the messages protocol is implementation agnostic. Generic. We cannot and do not want to add a property into a single language. Thus, your workerId attribute is too specific to cucumber-js. I am not sur such change would be accepted. What is your exact need related to cucumber-js? We can certainly find other ways to help! |
I think, we can extend the type right in the |
Like this: Message & { workerId?: string } |
I think so, yes 👌 Thanks for your understanding 🙂 How do you integrate cucumber-js with allure? Do you use a custom formatter? |
Yes, we do. You can check it here |
Ok, thanks Adding the workerId as part of the formatter is not possible? (this is a legit question!) |
It would be possible only if the messages contain I opened a PR to const { Formatter } = require('@cucumber/cucumber')
class ExampleFormatter extends Formatter {
constructor(options) {
options.eventBroadcaster.on('envelope', (envelope) => {
if (envelope.workerId) {
console.log(`the envelope was sent from a worker with id ${envelope.workerId}`)
} else {
console.log('the envelope was sent outside of any worker')
}
})
super(options)
}
}
module.exports = ExampleFormatter |
Thanks 👍 |
Summary
Provide optional
workerId
property toMessage
typeDetails
workerId
property, which can be useful for some cases, when you need to capture additional testing details. The changes required only forjavascript
message type because most of another platforms don't have problem with thread ID identifying.Then I want to provide additional PR for
cucumber-js
where I plan to use the property.Motivation and Context
allure-cucumberjs
needs to have access to thread or worker id for better reports.How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: