Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd78dfa
Add in ambiguous step definitions
luke-hill Dec 11, 2025
4b1f6c4
Add in global hooks cck examples and doc string primitive example
luke-hill Dec 11, 2025
6600070
Add final global hooks test
luke-hill Dec 11, 2025
4c2101e
WIP fr minimal reversed feature
luke-hill Dec 11, 2025
196627f
Fix other ref to cck
luke-hill Dec 11, 2025
4942c70
DRY up and use arguments file in cck proper
luke-hill Dec 11, 2025
910fb52
Added all remaining step def code
luke-hill Dec 11, 2025
885b912
Alleviate issue with extra args not appearing at end by forcibly movi…
luke-hill Dec 11, 2025
63403a9
Added changelog message;
luke-hill Dec 16, 2025
546b90d
Merge branch 'main' into refactor/update_cck_conformance
luke-hill Dec 16, 2025
bf09887
Added extra cck retry steps
luke-hill Dec 16, 2025
e656a8f
Document current status quo of cck compliance / conformance and enabl…
luke-hill Jan 13, 2026
a9dea52
Fix up namespace to align
luke-hill Jan 15, 2026
78d9fa5
Merge branch 'main' into refactor/update_cck_conformance
luke-hill Jan 15, 2026
e30b1f7
Fix bad replace on require path
luke-hill Jan 15, 2026
aac36c7
Fix compatibilitykit tests;
luke-hill Jan 15, 2026
aa93bb0
Skip flaky test on JRuby
luke-hill Jan 15, 2026
ac1a937
Merge branch 'main' into refactor/update_cck_conformance
luke-hill Mar 2, 2026
c094118
Add override for CCK v29 issue for one specific error (Children being…
luke-hill Mar 2, 2026
76fe9d1
Enable 2 more CCK examples now the code has been implemented
luke-hill Mar 2, 2026
226f7f2
Retry is also fixed
luke-hill Mar 2, 2026
d531a73
Add missing steps for backgrounds feature
luke-hill Mar 17, 2026
b8a0f81
Mark backgrounds tests for CCK as passing
luke-hill Mar 17, 2026
3244462
Fix before all and after all steps
luke-hill Mar 17, 2026
343f965
Merge branch 'main' into refactor/update_cck_conformance
luke-hill Mar 17, 2026
e058d64
Fix up rubocop TODO
luke-hill Mar 17, 2026
ab563af
Switch CI to only run passing scenarios
luke-hill Mar 17, 2026
99ead9c
Remove superfluous hook
luke-hill Mar 18, 2026
8573bda
Add debugging notes about missing message count
luke-hill Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2026-03-17 23:06:46 UTC using RuboCop version 1.85.1.
# on 2026-03-17 23:57:03 UTC using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -10,7 +10,7 @@
# TODO - [LH] -> Mar '25 (v10 prep) - 370 files inspected, 721 offenses detected, 116 offenses autocorrectable
# TODO - [LH] -> Dec '25 - 375 files inspected, 713 offenses detected, 109 offenses autocorrectable
# TODO - [LH] -> Dec '25 (query prep) - 378 files inspected, 729 offenses detected, 109 offenses autocorrectable
# TODO - [LH] -> Mar '26 (v11 prep) - 378 files inspected, 732 offenses detected, 109 offenses autocorrectable
# TODO - [LH] -> Mar '26 (v11 prep) - 389 files inspected, 747 offenses detected, 108 offenses autocorrectable

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Expand Down Expand Up @@ -39,6 +39,12 @@ Lint/UselessAccessModifier:
Exclude:
- 'lib/cucumber/formatter/curl_option_parser.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/UselessAssignment:
Exclude:
- 'compatibility/cck_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
Expand Down Expand Up @@ -66,12 +72,12 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 12

# Offense count: 82
# Offense count: 83
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 65

# Offense count: 14
# Offense count: 12
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 804
Expand Down Expand Up @@ -181,7 +187,7 @@ RSpec/ExpectOutput:
Exclude:
- 'spec/cucumber/formatter/interceptor_spec.rb'

# Offense count: 61
# Offense count: 58
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
Expand All @@ -195,15 +201,22 @@ RSpec/IndexedLet:
- 'spec/cucumber/filters/retry_spec.rb'
- 'spec/cucumber/glue/registry_and_more_spec.rb'

# Offense count: 52
# Offense count: 64
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/cucumber/cli/options_spec.rb'
- 'spec/cucumber/formatter/interceptor_spec.rb'
- 'spec/cucumber/formatter/json_spec.rb'
- 'spec/cucumber/formatter/query/hook_by_test_step_spec.rb'
- 'spec/support/shared_context/http_server.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/LeadingSubject:
Exclude:
- 'spec/cucumber/cli/main_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
RSpec/MatchArray:
Expand All @@ -229,7 +242,7 @@ RSpec/MissingExampleGroupArgument:
RSpec/MultipleExpectations:
Max: 3

# Offense count: 39
# Offense count: 37
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 10
Expand All @@ -254,10 +267,10 @@ RSpec/NamedSubject:
- 'spec/cucumber/runtime/support_code_spec.rb'
- 'spec/cucumber/runtime_spec.rb'

# Offense count: 2
# Offense count: 8
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 4
Max: 5

# Offense count: 22
# Configuration parameters: AllowedPatterns.
Expand Down Expand Up @@ -295,11 +308,12 @@ RSpec/ScatteredLet:
Exclude:
- 'spec/cucumber/runtime/support_code_spec.rb'

# Offense count: 1
# Offense count: 2
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
# SupportedInflectors: default, active_support
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/cucumber/cli/rerun_spec.rb'
- 'spec/cucumber/formatter/interceptor_spec.rb'

# Offense count: 7
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo

## [Unreleased]
### Added
- Add timestamp to `Attachment` message
- Added a new option for running order `--reverse` which will run the scenarios in reverse order ([#1807](https://github.com/cucumber/cucumber-ruby/pull/1807) [luke-hill](https://github.com/luke-hill))
- A first initial iteration of the new `cucumber-query` structure ([#1801](https://github.com/cucumber/cucumber-ruby/pull/1801) [luke-hill](https://github.com/luke-hill))
> This will be used for the migration of all existing formatters - becoming the building blocks for the future of cucumber formatters
Expand Down
36 changes: 30 additions & 6 deletions compatibility/cck_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true

require_relative 'support/shared_examples'
require_relative 'support/cck/examples'
require_relative 'support/compatibility_kit'

require 'cck/examples'
require 'cucumber/compatibility_kit'

# This is the implementation of the CCK testing for cucumber-ruby
# It will run each example from the CCK that is of type "gherkin" (As "markdown" examples aren't implemented in ruby)
Expand All @@ -13,13 +13,37 @@
describe CCK, :cck do
let(:cucumber_command) { 'bundle exec cucumber --publish-quiet --profile none --format message' }

CCK::Examples.gherkin.each do |example_name|
# CCK v22 conformance status update - Mar 2026
# OVERALL: 93 examples, 7 failures, 86 passed
# SANITIZED: 81 examples, 0 failures, 81 passed

# Global Hooks -> 23 messages generated - Expected 31 (Missing 4 testRunHookStarted + 4 testRunHookFinished)
# Global Hooks Before All -> 0 messages generated - Expected 22
# Global Hooks Attachments -> 0 messages generated - Expected 20
# Global Hooks After All -> 17 messages generated - Expected 27 (Missing 5 testRunHookStarted + 5 testRunHookFinished)

items_to_fix =
%w[
global-hooks
global-hooks-afterall-error
global-hooks-attachments
global-hooks-beforeall-error
]
failing, passing = CompatibilityKit.gherkin.partition { |name| items_to_fix.include?(name) }

failing.each do |example_name|
describe "'#{example_name}' example" do
include_examples 'cucumber compatibility kit' do
let(:example) { example_name }
let(:extra_args) { example == 'retry' ? '--retry 2' : '' }
let(:support_code_path) { CCK::Examples.supporting_code_for(example) }
let(:messages) { `#{cucumber_command} #{extra_args} --require #{support_code_path} #{cck_path}` }
let(:extra_args) do
if File.exist?("#{cck_path}/#{example}.arguments.txt")
File.read("#{cck_path}/#{example}.arguments.txt").to_s
else
''
end
end
let(:support_code_path) { CompatibilityKit.supporting_code_for(example) }
let(:messages) { `#{cucumber_command} --require #{support_code_path} #{cck_path} #{extra_args}` }
end
end
end
Expand Down
9 changes: 9 additions & 0 deletions compatibility/features/ambiguous/ambiguous_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

Given(/^a (.*?) with (.*?)$/) do |_arg1, _arg2|
# no-op
end

Given(/^a step with (.*)$/) do |_arg1|
# no-op
end
13 changes: 13 additions & 0 deletions compatibility/features/backgrounds/backgrounds_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

Given('an order for {string}') do |_arg1|
# no-op
end

When('an action') do
# no-op
end

Then('an outcome') do
# no-op
end
5 changes: 5 additions & 0 deletions compatibility/features/doc-strings/doc-strings_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Given('a doc string:') do |doc_string|
# no-op
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

BeforeAll do
# no-op
end

BeforeAll do
# no-op
end

When('a step passes') do
# no-op
end

AfterAll do
# no-op
end

AfterAll do
raise 'AfterAll hook went wrong'
end

AfterAll do
# no-op
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

BeforeAll do
attach('Attachment from BeforeAll hook', 'text/plain')
end

When('a step passes') do
# no-op
end

AfterAll do
attach('Attachment from AfterAll hook', 'text/plain')
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

BeforeAll do
# no-op
end

BeforeAll do
raise 'BeforeAll hook went wrong'
end

BeforeAll do
# no-op
end

When('a step passes') do
# no-op
end

AfterAll do
# no-op
end

AfterAll do
# no-op
end
25 changes: 25 additions & 0 deletions compatibility/features/global-hooks/global-hooks_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

BeforeAll do
# no-op
end

BeforeAll do
# no-op
end

When('a step passes') do
# no-op
end

When('a step fails') do
raise 'Exception in step'
end

AfterAll do
# no-op
end

AfterAll do
# no-op
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Given('an order for {string}') do |_item|
# no-op
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Given('an order for {string}') do |_item|
# no-op
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Given(/^a (.*?)(?: and a (.*?))?(?: and a (.*?))?$/) do |_vegetable1, _vegetable2, _vegetable3|
# no-op
end
12 changes: 12 additions & 0 deletions compatibility/features/retry/retry_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@
Given('a step that always fails') do
raise 'Exception in step'
end

Given('an ambiguous step') do
# first one
end

Given('an ambiguous step') do
# second one
end

Given('a pending step') do
pending('')
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

Given('an order for {string}') do |_item|
# no-op
end

When('an action') do
# no-op
end

Then('an outcome') do
# no-op
end
9 changes: 9 additions & 0 deletions compatibility/features/unused-steps/unused-steps_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

Given('a step that is used') do
# no-op
end

Given('a step that is not used') do
# no-op
end
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

require_relative '../../support/cck/examples'
require_relative '../support/compatibility_kit'

describe CCK::Examples do
let(:features_path) { File.expand_path("#{File.dirname(__FILE__)}/../../features") }
describe CompatibilityKit do
let(:features_path) { File.expand_path("#{File.dirname(__FILE__)}/../features") }

describe '#supporting_code_for' do
describe '.supporting_code_for' do
context 'with an example that exists' do
it 'returns the path of the folder containing the supporting code for the example' do
expect(described_class.supporting_code_for('hooks')).to eq("#{features_path}/hooks")
Expand Down
21 changes: 0 additions & 21 deletions compatibility/support/cck/examples.rb

This file was deleted.

Loading
Loading