From 440b918721f8a1e685a78cf344828e0d23cccba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 09:34:04 +0000 Subject: [PATCH 1/6] Load the wire protocol plugin explicitly in the examples Cucumber-Ruby 8 removed the built-in wire protocol support. Without `require 'cucumber/wire'` in a support file it silently ignores the .wire files: Cucumber never connects to the wire server and all steps of the examples are undefined. Cucumber-Ruby 7.1 still loads the plugin by itself, but warns that this is deprecated. With the support file it uses the explicitly loaded plugin and the warning disappears. See: https://github.com/cucumber/cucumber-ruby/blob/v7.1.0/UPGRADING.md#upgrading-to-710 Assisted-by: Claude Code --- examples/Calc/features/support/wire.rb | 2 ++ examples/CalcQt/features/support/wire.rb | 2 ++ examples/FeatureShowcase/features/support/wire.rb | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 examples/Calc/features/support/wire.rb create mode 100644 examples/CalcQt/features/support/wire.rb create mode 100644 examples/FeatureShowcase/features/support/wire.rb diff --git a/examples/Calc/features/support/wire.rb b/examples/Calc/features/support/wire.rb new file mode 100644 index 00000000..0e1eb3fd --- /dev/null +++ b/examples/Calc/features/support/wire.rb @@ -0,0 +1,2 @@ +# Cucumber-Ruby 8 and later only load the wire protocol plugin on request +require 'cucumber/wire' diff --git a/examples/CalcQt/features/support/wire.rb b/examples/CalcQt/features/support/wire.rb new file mode 100644 index 00000000..0e1eb3fd --- /dev/null +++ b/examples/CalcQt/features/support/wire.rb @@ -0,0 +1,2 @@ +# Cucumber-Ruby 8 and later only load the wire protocol plugin on request +require 'cucumber/wire' diff --git a/examples/FeatureShowcase/features/support/wire.rb b/examples/FeatureShowcase/features/support/wire.rb new file mode 100644 index 00000000..0e1eb3fd --- /dev/null +++ b/examples/FeatureShowcase/features/support/wire.rb @@ -0,0 +1,2 @@ +# Cucumber-Ruby 8 and later only load the wire protocol plugin on request +require 'cucumber/wire' From 436332d89e9077e4b7105b60ced71ec6d907942a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 09:35:23 +0000 Subject: [PATCH 2/6] Fail the functional tests on undefined steps Cucumber exits successfully even if steps are undefined. When it does not load the wire plugin, it never connects to the wire server and reports all steps as undefined. The scripts then wait forever for the wire server, which is still waiting for a connection. Run Cucumber in strict mode so that undefined and pending steps fail the run and the scripts stop before waiting for the wire server. Assisted-by: Claude Code --- .github/workflows/qt5.yaml | 2 +- run-linux.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/qt5.yaml b/.github/workflows/qt5.yaml index 15119e44..d613d58b 100644 --- a/.github/workflows/qt5.yaml +++ b/.github/workflows/qt5.yaml @@ -80,6 +80,6 @@ jobs: ; do "${TEST}" 2> /dev/null & sleep 1 - (cd examples/CalcQt; cucumber) + (cd examples/CalcQt; cucumber --strict) wait % done diff --git a/run-linux.sh b/run-linux.sh index 62518385..a23bb2fd 100755 --- a/run-linux.sh +++ b/run-linux.sh @@ -36,7 +36,7 @@ for TEST in \ ; do "${TEST}" > /dev/null & sleep 1 - (cd examples/Calc; cucumber) + (cd examples/Calc; cucumber --strict) wait % done @@ -51,7 +51,7 @@ for TEST in \ ; do "${TEST}" 2> /dev/null & sleep 1 - (cd examples/CalcQt; cucumber) + (cd examples/CalcQt; cucumber --strict) wait % done @@ -63,7 +63,7 @@ SOCK=`pwd`/cucumber.wire.sock TEST=build/examples/FeatureShowcase/FeatureShowcaseSteps echo "unix: ${SOCK}" > examples/FeatureShowcase/features/step_definitions/cucumber.wire "${TEST}" --unix "${SOCK}" > /dev/null & -(cd examples/FeatureShowcase; cucumber) +(cd examples/FeatureShowcase; cucumber --strict) wait % mkdir -p coverage From c129d9c99b5745f6c6f634ca2e668d4e9a9f59a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 10:03:59 +0000 Subject: [PATCH 3/6] Make the Cucumber-Ruby version selectable in the Gemfile Select the Cucumber-Ruby version with the CUCUMBER_VERSION environment variable to test the wire protocol against more than one version. Each version comes with the matching cucumber-wire release: * 7.1 (default): cucumber 7.1.0 and cucumber-wire 6.2.1 as before * 10: cucumber 10.2.0 and cucumber-wire 8.0.0, the latest releases that support the wire protocol. They need Ruby 3.1 or later. Cucumber-Ruby 11 and later need a new cucumber-wire release first. Assisted-by: Claude Code --- Gemfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index d53a1beb..92814591 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,18 @@ source 'https://rubygems.org' -group :test do - gem 'cucumber', "=7.1.0" - gem 'cucumber-wire', "=6.2.1" +# Select the Cucumber-Ruby version with CUCUMBER_VERSION, for example +# `export CUCUMBER_VERSION=10` before `bundle install`. Keep it set for `bundle exec`, +# otherwise Bundler switches back to the default. Cucumber-Ruby 10 needs Ruby 3.1 or later. +cucumber_versions = { + '7.1' => { cucumber: '7.1.0', wire: '6.2.1' }, + '10' => { cucumber: '10.2.0', wire: '8.0.0' }, +} +cucumber_version = ENV.fetch('CUCUMBER_VERSION', '7.1') +versions = cucumber_versions.fetch(cucumber_version) do + raise "Unsupported CUCUMBER_VERSION '#{cucumber_version}', use one of: #{cucumber_versions.keys.join(', ')}" end +group :test do + gem 'cucumber', "=#{versions[:cucumber]}" + gem 'cucumber-wire', "=#{versions[:wire]}" +end From 5c3d5e0fc0d0780fcda07cc73ea7a9aa686d3889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 10:04:17 +0000 Subject: [PATCH 4/6] Run the functional tests with Cucumber-Ruby 7.1 and 10 Run the Linux build once per supported Cucumber-Ruby version, so that an incompatibility shows up as a failing build. Cucumber-Ruby 10 needs Ruby 3.1 or later. Ubuntu 22.04 provides Ruby 3.0 only, so that configuration runs on Ubuntu 24.04. The Cucumber-Ruby 7.1 configuration stays on Ubuntu 22.04 as before. Ubuntu 24.04 also comes with newer compilers and libraries (e.g. GCC 13, Qt 6.4, Boost 1.83), so a failure that only shows up in that configuration is not necessarily caused by Cucumber-Ruby. Assisted-by: Claude Code --- .github/workflows/run-all.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all.yaml b/.github/workflows/run-all.yaml index 5dda7406..03b71966 100644 --- a/.github/workflows/run-all.yaml +++ b/.github/workflows/run-all.yaml @@ -16,7 +16,20 @@ concurrency: jobs: build-linux: - runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - cucumber-version: '7.1' + os: ubuntu-22.04 + # Cucumber-Ruby 10 needs Ruby 3.1 or later, Ubuntu 22.04 provides Ruby 3.0 + - cucumber-version: '10' + os: ubuntu-24.04 + + runs-on: ${{ matrix.os }} + + env: + CUCUMBER_VERSION: ${{ matrix.cucumber-version }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -46,7 +59,7 @@ jobs: - name: install ruby tools run: | sudo gem install bundler - sudo bundle install + sudo env CUCUMBER_VERSION="${CUCUMBER_VERSION}" bundle install - name: install gtest run: | From ae32890a37c4473bf5f42ac9e73ce7d7d9a856fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 10:04:30 +0000 Subject: [PATCH 5/6] Update the README for Cucumber-Ruby 8 and later Replace the warning about Cucumber-Ruby 3.x. The doc string bug it refers to (cucumber/cucumber-ruby#1183) only affected Cucumber-Ruby 2.0.x and was fixed in 2.1.0. The wire protocol works with Cucumber-Ruby 7.1 and 10. Instead, describe what current versions need: the cucumber-wire plugin, a support file that loads it and starting Cucumber in the folder that contains the features. Without --require, Cucumber only loads support and .wire files from ./features (see #277), so the Windows instructions, which ran `cucumber examples\Calc` from the repository root, left all steps undefined. Change into the example folder first, as the Unix instructions do. Assisted-by: Claude Code --- README.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f6e86813..7aa28857 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,12 @@ It might work with earlier versions of the libraries, but it was not tested with See the [CI scripts](.github/workflows/run-all.yml) for details about dependency installation. Cucumber-Cpp uses the wire protocol at the moment, so you will need -Cucumber-Ruby installed and available on the path. It is also needed -to run the functional test suite. +Cucumber-Ruby and its cucumber-wire plugin installed and available on +the path. They are also needed to run the functional test suite. -Please mind that Cucumber-Cpp is not compatible with Cucumber-Ruby 3.x -due to a [bug in its wire protocol](https://github.com/cucumber/cucumber-ruby/issues/1183) -implementation. +Cucumber-Cpp is tested with Cucumber-Ruby 7.1 and 10. Later versions +are not supported yet, because there is no cucumber-wire release for +them. Cucumber-Ruby 10 needs Ruby 3.1 or later. To install the Ruby prerequisites: @@ -48,6 +48,10 @@ gem install bundler // For windows: gem install bundle bundle install ``` +This installs Cucumber-Ruby 7.1. To use Cucumber-Ruby 10 instead, set +the environment variable `CUCUMBER_VERSION=10` before running +`bundle install` and keep it set when running `bundle exec`. + ### Windows vs. Linux To get an inspiration on how to set up the dependencies on your specific system (Windows or Linux), you may want to have a look at the @@ -92,7 +96,8 @@ Running the Calc example on Windows (NMake): ``` start build\examples\Calc\BoostCalculatorSteps.exe -cucumber examples\Calc +cd examples\Calc +cucumber ``` ## The way it works @@ -131,8 +136,14 @@ host: localhost port: 3902 ``` +Cucumber-Ruby 8 and later ignore the *cucumber.wire* file unless the wire protocol plugin is loaded. Create a *wire.rb* file in the *features/support* folder with the following content (Cucumber-Ruby 7.1 works with it as well): + +``` +require 'cucumber/wire' +``` + Create your first feature (an example is available [here](examples/Calc/features/addition.feature)). Then create your step definition runner (an example is available [here](examples/Calc/features/step_definitions/BoostCalculatorSteps.cpp)). In order to compile the step definition runner, make sure to add [cucumber include directory](include/cucumber-cpp) to the include path and link with *libcucumber-cpp.a* and additional testing libraries (boost unit test). -Run the step definition runner in the background and then cucumber, like in the Calc example in the previous section. The step definition runner should exit after the feature is run and cucumber exits. +Run the step definition runner in the background and then cucumber, like in the Calc example in the previous section. Start cucumber in the folder that contains the *features* folder, otherwise it does not find the *cucumber.wire* file. The step definition runner should exit after the feature is run and cucumber exits. From 4a5cfc80aa6e4756c4cb51878d8ad7538e21b5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Br=C3=A4ndli?= Date: Fri, 30 Oct 2026 09:39:35 +0000 Subject: [PATCH 6/6] Fix links to the workflow files in the README The workflow files were renamed from .yml to .yaml, but the README still linked to the old names. Assisted-by: Claude Code --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7aa28857..f68feee7 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ It relies on a few libraries: * [TCLAP](https://tclap.sourceforge.net/) 1.2.5 or later. It might work with earlier versions of the libraries, but it was not tested with them. -See the [CI scripts](.github/workflows/run-all.yml) for details about dependency installation. +See the [CI scripts](.github/workflows/run-all.yaml) for details about dependency installation. Cucumber-Cpp uses the wire protocol at the moment, so you will need Cucumber-Ruby and its cucumber-wire plugin installed and available on @@ -55,7 +55,7 @@ the environment variable `CUCUMBER_VERSION=10` before running ### Windows vs. Linux To get an inspiration on how to set up the dependencies on your specific system (Windows or Linux), you may want to have a look at the -workflow files [for Windows](.github/workflows/windows-build.yml) and [for Linux](.github/workflows/linux-build.yml). +workflow files [for Windows](.github/workflows/windows-build.yaml) and [for Linux](.github/workflows/linux-build.yaml). ## Build