Skip to content

Commit

Permalink
fix: cucumber-ruby 9.2 includes breaking change for Cucumber::Core::T…
Browse files Browse the repository at this point in the history
…est::Result
  • Loading branch information
anmarchenko committed Mar 19, 2024
1 parent 7981912 commit 7abb315
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 91 deletions.
30 changes: 15 additions & 15 deletions gemfiles/jruby_9.4_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
30 changes: 15 additions & 15 deletions gemfiles/ruby_2.7_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
30 changes: 15 additions & 15 deletions gemfiles/ruby_3.0_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
30 changes: 15 additions & 15 deletions gemfiles/ruby_3.1_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
30 changes: 15 additions & 15 deletions gemfiles/ruby_3.2_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
30 changes: 15 additions & 15 deletions gemfiles/ruby_3.3_cucumber_9.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ GEM
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (9.1.2)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.2, >= 9.2.0)
cucumber-core (~> 12.0)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 27)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1, >= 1.1.5)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.3)
cucumber-ci-environment (9.2.0)
cucumber-core (12.0.0)
cucumber-gherkin (>= 25, < 27)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.1)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (~> 5.0, >= 5.0.4)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.0.2)
bigdecimal
cucumber-gherkin (26.2.0)
cucumber-messages (>= 19.1.4, < 22.1)
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.3.0)
cucumber-messages (> 19, < 25)
cucumber-messages (22.0.0)
cucumber-tag-expressions (5.0.6)
cucumber-tag-expressions (6.1.0)
ddtrace (1.21.0)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
Expand Down
12 changes: 11 additions & 1 deletion lib/datadog/ci/contrib/cucumber/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_suite_name(test_case)
end

def finish_span(span, result)
if !result.passed? && result.ok?(@config.strict)
if !result.passed? && ok?(result, @config.strict)
span.skipped!(reason: result.message)
elsif result.passed?
span.passed!
Expand Down Expand Up @@ -186,6 +186,16 @@ def extract_parameters_hash(test_case)
nil
end

def ok?(result, strict)
# in minor update in Cucumber 9.2.0, the arity of the `ok?` method changed
parameters = result.method(:ok?).parameters
if parameters == [[:opt, :be_strict]]
result.ok?(strict)
else
result.ok?(strict: strict)
end
end

def configuration
Datadog.configuration.ci[:cucumber]
end
Expand Down
2 changes: 2 additions & 0 deletions sig/datadog/ci/contrib/cucumber/formatter.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ module Datadog

def extract_parameters_hash: (untyped test_case) -> Hash[String, String]?

def ok?: (Cucumber::Core::Test::Result result, untyped strict) -> bool

def configuration: () -> untyped
end
end
Expand Down

0 comments on commit 7abb315

Please sign in to comment.