Skip to content

Support cucumber ruby 10 - #320

Open
mbraendli wants to merge 6 commits into
cucumber:mainfrom
mbraendli:support-cucumber-ruby-10
Open

mbraendli wants to merge 6 commits into
cucumber:mainfrom
mbraendli:support-cucumber-ruby-10

Conversation

@mbraendli

Copy link
Copy Markdown

Summary

The examples failed in Cucumber 8 to 10.x because the “wire” plugin was not loaded. (Version 11 and later would need a new cucumber-wire-Release) The steps were undefined, and the test suite got stuck. The analysies, implementation and test were realized with Claude Code, manual tests and reviews were done for all changes.

Details

The changes include:

  • Load the wire plugin: Added features/support/wire.rb to Calc, CalcQt, and FeatureShowcase.
  • Fail on undefined steps: run-linux.sh and qt5.yaml now use --strict. Missing step definitions will fail the build.
  • Selectable Cucumber version: The Gemfile reads CUCUMBER_VERSION. It defaults to 7.1 but supports 10.
  • CI matrix: run-all.yaml tests 7.1 on Ubuntu 22.04 and 10 on Ubuntu 24.04 (Cucumber 10 needs Ruby ≥ 3.1). NOTE: this ist the first job on ubuntu-24.04
  • README:
    • Removed the warning about Cucumber 3.x., since it was fixed in cucumber-ruby 2.1.0 (The Bug was only in 2.0.x)
    • Added instructions for wire.rb.
    • Added instruction for cucumber start in features/ directory
    • Windows instructions now start in the example directory.
    • Fixed workflow links from .yml to .yaml.

Motivation and Context

This software is actively used in our project. Because the README was outdated, we never updated Cucumber in our test infrastructure. This PR fixes the compatibility issue and helps other users upgrade to newer versions.

How Has This Been Tested?

Tested locally on Linux (GCC 15, CUKE_STRICT=on) with Calc (GTest, Boost, FuncArgs) and FeatureShowcase:

Cucumber-Ruby / cucumber-wire Before After
7.1.0 / 6.2.1 passed, with deprecation warning passed, no warning
10.2.0 / 8.0.0 all steps undefined, exit code 0, wire server keeps waiting passed
10.2.0 / 8.0.0 without wire.rb fails with exit code 1
  • for both versions the bundle install with the new Gemfile works.
  • actionlint and zizmor report no new findings
  • unit-tests are green

Tested in CI with an exception of the already failing windows builds: CI-Run

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:

  • It is my own work, its copyright is implicitly assigned to the project and no substantial part of it has been copied from other sources (including Stack Overflow). In rare occasions this is acceptable, like in CMake modules where the original copyright information should be kept.
  • I'm using the same code standards as the existing code (indentation, spacing, variable naming, ...).
  • I've added tests for my code.
  • I have verified whether my change requires changes to the documentation
  • My change either requires no documentation change or I've updated the documentation accordingly.
  • My branch has been rebased to main, keeping only relevant commits.

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
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
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
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
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 cucumber#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
The workflow files were renamed from .yml to .yaml, but the README
still linked to the old names.

Assisted-by: Claude Code
@mbraendli mbraendli mentioned this pull request Oct 30, 2026
6 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant