Wire protocol broke backwards compatibility for docstrings
muggenhor opened this issue · comments
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.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
The issue still exists, I don't have the ruby chops to fix it, but it's still relevant.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.
Problem still exists.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
ping
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
@raphaelmeyer was it this you mentioned today?
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.