bugfix: HTML Formatter and its envelopes#1891
Conversation
|
@oellul this is a quick attempt at fixing it. One thing to note, is this might not play well with attachments, especially those from hooks. So for now I want to let this sit for a short while |
|
No worries, take your time. My monkey-patch seems to be serving my use case well for now (probably because I don't use attachments) |
|
@oellul can you test this branch though with attachments. To see if you can remove your monkeypatch. I want to merge this in as it is an oversight on our end |
|
Sure thing, I'll test it out tomorrow and let you know |
|
@luke-hill You're right, it doesn't play well with attachments. This step def When('I attach an image') do
image_path = File.read('image.jpeg', mode: 'rb')
attach(image_path, 'image/jpeg')
endis failing with error message This particular issue is fixed when changing |
* Fix up arabic translation example Fix step defs to use native terms Fix capture to ensure scenario will work * Permit arabic to run again in CI * Switch ukranian to use anglicised step def code to permit example to be ran in CI - Still validly testing the parser and the localised terms in gherkin * Switch uzbek to use anglicised step def code to permit example to be ran in CI - Still validly testing the parser and the localised terms in gherkin * Switch russian to use anglicised step def code to permit example to be ran in CI - Still validly testing the parser and the localised terms in gherkin * Enhance test suite to run all new examples * Add note * Add changelog
* Remove the ancient procedure call interface from formatters completely * Until now the data from "attach" and "log" calls from step definitions has been passed to the formatter using the ancient procedure call interface used in Cucumber-Ruby v1 and v2. From Cucumber-Ruby v3 all other data to formatters has been passed using events. * Introduce an event AttachCalled to pass the data from "attach" and "log" calls from step definitions to event listeners like formatters. * Update Changelog.md
e34037c to
4134b83
Compare
52f9a52 to
55d09e7
Compare
|
Not quite sure what went on with merges / interactive rebases but @oellul could you take a look here again. Both with positive and negative scenarios for the html formatter |
|
@luke-hill Please excuse the delay, it's been a busy week so far. I will try get on this before the weekend. |
|
Never any timelines in OSS, do it when you can. I'm busy for a couple of weeks now |
|
Hi @luke-hill , attachments seem to be working fine now. However, I did notice another issue where messages in the html report are duplicated. This seems to be because a Formatter::MessageBuilder instance is being created in runtime.rb, and again due to the HTML formatter now also inheriting MessageBuilder. I was able to fix this locally with this change to def create_formatters
# the formatters defined by the cli options
formatters
# Until all messages are generated at the source the message_builder
# is necessary — skip it when a user formatter already inherits from
# MessageBuilder (e.g. HTML) to avoid sending every event twice.
message_builder unless formatters.any? { |f| f.is_a?(Formatter::MessageBuilder) }
# summary_report and global_hooks_summary_report is use to determine
# the exit code
summary_report
global_hooks_summary_report
fail_fast_report if @configuration.fail_fast?
publish_banner_printer unless @configuration.publish_quiet?
endI ran some basic tests with other formatters and they seem to still be working properly with this change. Since I don't have permissions to push to this branch I'll create a PR at some point to beef up the html formatter scenarios |
Description
Fix HTML formatter not running output_envelope correctly
fixes #1890
Type of change
Please delete options that are not relevant.
Please add an entry to the relevant section of CHANGELOG.md as part of this pull request.
Checklist:
Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.
bundle exec rubocopreports no offenses