Skip to content

Commit

Permalink
ruby 3.3 (#958)
Browse files Browse the repository at this point in the history
* ruby 3.3

* fix spinach needing racc

* fix windows having fixed oder + anison warning
  • Loading branch information
grosser committed May 20, 2024
1 parent f2e9553 commit 632e3be
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: test

on:
push:
pull_request:

jobs:
Expand All @@ -10,7 +9,7 @@ jobs:
strategy:
fail-fast: false # run all tests so we see which gem/ruby combinations break
matrix:
ruby: ['3.0', '3.1', '3.2', head, jruby-head]
ruby: ['3.0', '3.1', '3.2', '3.3', head, jruby-head]
os: [ubuntu-latest, windows-latest]
task: [spec]
include:
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gem 'minitest', '~> 5.5.0'
gem 'rspec', '~> 3.3'
gem 'cucumber', "~> 4.0"
gem 'cuke_modeler', '~> 3.6'
gem 'spinach', '~> 0.12'
gem 'spinach'
gem 'racc' # need for spinach on 3.3+ https://github.com/codegram/spinach/issues/256
gem 'rake'
gem 'rubocop', '~> 1.51.0' # lock minor so we do not get accidental violations
7 changes: 5 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GEM
ast (2.4.2)
builder (3.2.4)
bump (0.10.0)
colorize (0.8.1)
colorize (1.1.0)
concurrent-ruby (1.1.10)
cucumber (4.1.0)
builder (~> 3.2, >= 3.2.3)
Expand Down Expand Up @@ -72,6 +72,8 @@ GEM
middleware
thor
thread_safe
racc (1.8.0)
racc (1.8.0-java)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.0)
Expand Down Expand Up @@ -129,10 +131,11 @@ DEPENDENCIES
cuke_modeler (~> 3.6)
minitest (~> 5.5.0)
parallel_tests!
racc
rake
rspec (~> 3.3)
rubocop (~> 1.51.0)
spinach (~> 0.12)
spinach
test-unit

BUNDLED WITH
Expand Down
3 changes: 2 additions & 1 deletion spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,13 @@ def test_unicode
write "features/fail2.feature", "Feature: xxx\n Scenario: xxx\n Given I fail"
results = run_tests ["features"], processes: 3, type: "cucumber", fail: true

failing_scenarios = if Gem.win_platform?
failing_scenarios = if Gem.win_platform? && RUBY_VERSION < "3.3.0"
["cucumber features/fail1.feature:2 # Scenario: xxx", "cucumber features/fail2.feature:2 # Scenario: xxx"]
else
["cucumber features/fail2.feature:2 # Scenario: xxx", "cucumber features/fail1.feature:2 # Scenario: xxx"]
end

results.gsub!(/.*WARNING.*\n/, "")
expect(results).to include <<-EOF.gsub(' ', '')
Failing Scenarios:
#{failing_scenarios[0]}
Expand Down
13 changes: 12 additions & 1 deletion spec/parallel_tests/cucumber/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ def call(*args)
"Failing Scenarios:", "cucumber features/failure:3", "cucumber features/failure:4",
"Failing Scenarios:", "cucumber features/failure:5", "cucumber features/failure:6"
]
expect(call(results)).to eq("Failing Scenarios:\ncucumber features/failure:1\ncucumber features/failure:2\ncucumber features/failure:3\ncucumber features/failure:4\ncucumber features/failure:5\ncucumber features/failure:6\n\n")
output = call(results)
output.gsub!(/.*WARNING.*\n/, "")
expect(output).to eq(<<~TXT)
Failing Scenarios:
cucumber features/failure:1
cucumber features/failure:2
cucumber features/failure:3
cucumber features/failure:4
cucumber features/failure:5
cucumber features/failure:6
TXT
end

it "collates flaky scenarios separately" do
Expand Down
2 changes: 1 addition & 1 deletion spec/parallel_tests/test/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def call(*args)
end

it "uses given when passed found" do
result = Gem.win_platform? ? [["a", "b"], ["c"]] : [["a", "c"], ["b"]]
result = (Gem.win_platform? && RUBY_VERSION < "3.3.0" ? [["a", "b"], ["c"]] : [["a", "c"], ["b"]])
expect(call(["a", "b", "c"], 2, group_by: :found)).to eq(result)
end

Expand Down

0 comments on commit 632e3be

Please sign in to comment.