Skip to content

Wire protocol broke backwards compatibility for docstrings #1183

Closed
cucumber/cucumber-ruby-wire
#15
@muggenhor

Description

@muggenhor

Summary

Starting from no later than cucumber 2.0 backwards compatibility of the wireprotocol got broken for passing docstrings.

Given this step definition (cucumber-cpp):

GIVEN("some step with a docstring")
{
  REGEX_PARAM(std::string, docstring);
  EXPECT_EQ("doc string goes here", docstring);
}

and this feature:

Feature: test
  Scenario: test
    Given some step with a docstring
      """
      doc string goes here
      """
    When not implemented
    Then not implemented

Expected Behavior

I expect the step definition to be called and passed the doc string. This requires this bit of JSON to fly across the wire (the id field is an example):

["invoke",
  {
    "id":"27",
    "args":[
      "doc string goes here"
    ]
  }
]

Current Behavior

With cucumber 1.3.8 (delivered with Ubuntu Trusty 14.04) the expectation is met, with Cucumber 2.0.0 (delivered with Ubuntu Xenial 16.04) however this fails. Instead an exception is thrown, from the implementation of the REGEX_PARAM macro, carrying the message "Parameter not found". This is the result of the transmitted JSON not being usable anymore, because it now looks like this instead:

["invoke",
  {
    "id":"27",
    "args":[
      {
        "delegate_sd_obj":{
          "content":"doc string goes here",
          "content_type":"",
          "location":"features/some-file.feature:25..27",
          "delegate_sd_obj":"doc string goes here"
        }
      }
    ]
  }
]

Possible Solution

This seems to be the cause of serializing Delegator structures internally.

Steps to Reproduce (for bugs)

Running the FeatureShowcase example on the docstring-wire-bug branch of muggenhor/cucumber-cpp with cucumber 1.3.8 will succeed, with 2.0 it will fail.

Context & Motivation

This keeps my company from being able to upgrade our CI infrastructure to more recent Ubuntu versions as it ships with Cucumber 2.0.

Your Environment

Ubuntu Xenial 16.04 with Cucumber 2.0, cucumber-cpp HEAD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions