Skip to content

event-protocol: Add ruby formatter#173

Merged
mattwynne merged 2 commits intoevent-protocol-test-resultsfrom
event-protocol-add-ruby-formatter
May 15, 2017
Merged

event-protocol: Add ruby formatter#173
mattwynne merged 2 commits intoevent-protocol-test-resultsfrom
event-protocol-add-ruby-formatter

Conversation

@mattwynne
Copy link
Member

Summary

Add a plugin for cucumber-ruby that produces events according to the protocol defined in #172

Details

This plugin emits the necessary NDJSON events for driving the prototype GUI (see #171) and satisfies the protocol defined in #172.

Motivation and Context

This provides the first version of a producer of the new test-result events proposed in #172. It can act as a reference implementation for other Cucumbers to follow when implementing their own.

Keeping the plugin here in the monorepo rather than in the cucumber-ruby codebase will enable other implementors to re-use tests (or perhaps we can even see how to develop a shared test suite).

Once this gem has been published, we'll use it as a dependency in Cucumber-Ruby 3.0, and make it one of the standard command-line options.

How Has This Been Tested?

The set of examples in /event-protocol/ruby/examples each contain an expected-events.ndjson. The RSpec tests for the project run Cucumber (with the plugin enabled) for each of the examples, and compare the output from the plugin with that file.

Because of some non-deterministic data in the events, the data is somewhat normalised before comparison. Read the code for details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@mattwynne mattwynne force-pushed the event-protocol-add-ruby-formatter branch 2 times, most recently from 43b7ff3 to afa562d Compare March 26, 2017 20:33
@mattwynne mattwynne force-pushed the event-protocol-add-ruby-formatter branch from afa562d to 88bab92 Compare March 26, 2017 20:35
@mattwynne
Copy link
Member Author

@aslakhellesoy the build is broken as there's no Makefile in the event-protocol directory anymore. Should I add one that builds both the Ruby plugin and runs the validator schema tests?

@aslakhellesoy
Copy link
Contributor

Yes please do. Each Makefile should have a default and clean target. Example parent Makefile here: https://github.com/cucumber/cucumber/blob/master/cucumber-expressions/Makefile

Copy link
Contributor

@aslakhellesoy aslakhellesoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, after fixing those two comments I made. If the Travis build passes, go ahead and merge it!

source 'https://rubygems.org'
gemspec

gem "cucumber", path: "../../../cucumber-ruby"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might work on your machine, but it breaks the build.

I suggest depending on the git repo (with a particular branch) instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I should have taken that out. Thanks!

@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Cucumber Limited and contributors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never add year to Copyright. It's not required and nobody remembers to update it.

This prepares the way for keeping protocol formatters / emitters
together in the event-protocol folder too.
@jbpros jbpros force-pushed the event-protocol-add-ruby-formatter branch from 598f861 to c4ccfef Compare May 5, 2017 12:55
@mattwynne mattwynne force-pushed the event-protocol-add-ruby-formatter branch from a6df1ea to 5606d2e Compare May 5, 2017 22:35
@mattwynne mattwynne dismissed aslakhellesoy’s stale review May 5, 2017 22:36

All dealt with

@mattwynne mattwynne merged commit c987e42 into event-protocol-test-results May 15, 2017
@aslakhellesoy aslakhellesoy deleted the event-protocol-add-ruby-formatter branch July 12, 2018 21:14
@lock
Copy link

lock bot commented Jul 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants