Skip to content

Commit 95f50c9

Browse files
authored
V10: Update dependencies (#1782)
* Unrestrict runtime deps * Remove rubocop-capybara as its no longer needed or suggested and slightly update rubocop gems * Slight tidy to interceptor spec * Update CCK testing version * Downgrade CCK to v17 whilst investigating issues * WIP for adding id to test run id * Fix duplicate testing block * Run release pipeline tests on 3.4 also * Update docs * Minor simplification to main runtime * Fix bug with deprecator message * Fix deprecator spec * Minor tidy to backtrace filter * Change ID generation to be much simpler - Add this to output envelope during the test run started event * Remove redundant input event when finding / generating test run id * Add Test run ID to test case ready event Change order of broadcast such that test case ready comes after test run started * Add test run started id to testrunfinished message * Hook refactors Rename phase to type for type of hook Add hook type to envelope creation Ensure enum conversion is adherent to message enum validation (Around hook is the outlier here - InstallPlugin can be converted adherently) * Downgrade CCK back to 16.2 and hardcode cck tests to just retry * Recommit v17 of CCK * Experiment move TestCaseReadyEvent lower down * Re-run all CCK tests again; * Change to CCK steps for v18 conformance * Update to v18 of cck * Triage one failing test * Bugfix wrong media type * Add in deprecated steps for CCK conformance (currently) * Add in truffleruby guard for some tests * Hard code the truffleruby test to use v24 * Add truffleruby 24 into release pipeline * Fix rubocop * Compress a few lines down * Re-test the whole of the CCK again * Clarify deprecation notice for CCK attachment steps * Remove redundant require for testrunstarted query * Fix missing arg in step * Tidy up of lines / style * Fix up bad copy and paste * Add CCK strawman for validating the testRunId consistency * Clean up test for id checking * Tidy up backtrace filter test * Optimise iterator for testRunStartId checks * Update CCK conformance in readme; * Switch back to truffleruby head * Add date time stamp for removal of pragma skip for truffleruby error; * Refactor filter into non-procedural code * Refactor specs partially to use a agnostic anonymous class * Remove iVar references and fix up remaining cop offenses * Initial mapped backtrace must always exist as some array so no need to check if it exists * Update CCK conformance note * Add in final changelogs for backtrace filtering * Bump minimum ruby to 3.1 over 3.0 owing to time taken for v10 conformance * Flag truffleruby support as v24+
1 parent c93bde2 commit 95f50c9

32 files changed

+332
-194
lines changed

.github/actions/test-ruby/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
ruby-version:
66
description: Version of ruby to use with ruby/setup-ruby@v1
77
required: false
8-
default: '3.0'
8+
default: '3.1'
99

1010
runs:
1111
using: "composite"

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ jobs:
1919
strategy:
2020
matrix:
2121
os: [ubuntu-latest, macos-latest, windows-latest]
22-
ruby: ['3.0', '3.1', '3.2', '3.3']
22+
ruby: ['3.1', '3.2', '3.3', '3.4']
2323
include:
2424
- os: ubuntu-latest
2525
ruby: jruby-9.4
26+
- os: ubuntu-latest
27+
ruby: truffleruby
2628
runs-on: ${{ matrix.os }}
2729
steps:
2830
- uses: actions/checkout@v4

.github/workflows/rubocop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: '3.0'
18+
ruby-version: '3.1'
1919
bundler-cache: true
2020
- run: bundle exec rubocop

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
ruby: ['3.0', '3.1', '3.2', '3.3', '3.4']
20+
ruby: ['3.1', '3.2', '3.3', '3.4']
2121
include:
2222
- os: ubuntu-latest
2323
ruby: jruby-9.4
2424
- os: ubuntu-latest
25-
ruby: truffleruby-head
25+
ruby: truffleruby
2626
runs-on: ${{ matrix.os }}
2727
steps:
2828
- uses: actions/checkout@v4

.rubocop.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ inherit_mode:
55
- Exclude
66

77
require:
8-
- rubocop-capybara
98
- rubocop-packaging
109
- rubocop-rake
1110
- rubocop-rspec
1211

1312
AllCops:
1413
NewCops: disable
1514
# Keep this inline with the lowest ruby version in the gemspec
16-
TargetRubyVersion: 3.0
15+
TargetRubyVersion: 3.1
1716
# Display cop name / style guide references
1817
DisplayCopNames: true
1918
DisplayStyleGuide: true

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
1111
## [Unreleased]
1212
### Changed
1313
- Added dependencies that will no longer be part of the ruby stdlib ([jeromeag](https://github.com/jerome))
14-
- Updated `cucumber-compatibility-kit` to v16 ([luke-hill](https://github.com/luke-hill))
14+
- Updated `cucumber-compatibility-kit` to v18
15+
- NB: This change has also facilitated a tweak to some output messages to include new fields such as `testRunStartedId`
16+
for full changes and expectations of what will be new check the [messages](https://github.com/cucumber/messages/blob/main/CHANGELOG.md#2700---2024-10-26)
17+
([luke-hill](https://github.com/luke-hill))
1518
- Changed compatibility testing to fully lean on external assets instead of duplicating them ([luke-hill](https://github.com/luke-hill))
1619
- Permit usage of latest versions of all cucumber internal gems
1720
- The auto-generation of all placeholder `pending` steps has been refactored (_There should be no visible changes
@@ -20,6 +23,8 @@ but the code is now refactored to work using newer ruby standards_)
2023
should lean on an appropriate testing library for this)
2124
- `Cucumber.use_legacy_autoloader` that was intended as a stop-gap for v4/v5 is now deprecated (People
2225
that need to rely on procedural loading / reloading of files should use method invocations) ([luke-hill](https://github.com/luke-hill))
26+
- The backtrace filtering logic has been changed (_There should be no visible changes but the code is now
27+
refactored to use newer, less procedural ruby_)
2328

2429
### Fixed
2530
- Fixed an issue where a change to one example in compatibility testing wasn't fully adhered to ([luke-hill](https://github.com/luke-hill))
@@ -32,7 +37,7 @@ that need to rely on procedural loading / reloading of files should use method i
3237
- Associated legacy scripts for updating dependencies that are no longer used
3338
- Tag Expressions using legacy syntax that were handled / sanitized are no longer done so
3439
(This applies to both regular usage and internal testing)
35-
- Removed support for Ruby 2.7 ([luke-hill](https://github.com/luke-hill))
40+
- Removed support for Ruby 2.7 and 3.0 (Minimum ruby is now 3.1) ([luke-hill](https://github.com/luke-hill))
3641
- Unindentation support for snippet generator / tests (Heredocs are much better now) ([luke-hill](https://github.com/luke-hill))
3742

3843
## [9.2.1] - 2025-01-12
@@ -70,7 +75,7 @@ All logic contained in [compatibility](./compatibility) ([luke-hill](https://git
7075

7176
## [9.1.0] - 2023-11-14
7277
### Changed
73-
- First couple of passes of tidying up approximately 40% of the manual fix cops
78+
- First iteration to tidy up approximately 40% of the manual fix cops
7479
([#1739](https://github.com/cucumber/cucumber-ruby/pull/1739) [#1740](https://github.com/cucumber/cucumber-ruby/pull/1740) [#1741](https://github.com/cucumber/cucumber-ruby/pull/1741) [#1742](https://github.com/cucumber/cucumber-ruby/pull/1742) [luke-hill](https://github.com/luke-hill))
7580
- Removed a bunch of example files / sample projects from ancient projects no longer viable
7681
([#1740](https://github.com/cucumber/cucumber-ruby/pull/1740) [luke-hill](https://github.com/luke-hill))

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ Later in this document, bundler is considered being used so all commands are usi
4545

4646
### Supported platforms
4747

48+
- Ruby 3.4
49+
- Ruby 3.3
4850
- Ruby 3.2
4951
- Ruby 3.1
5052
- Ruby 3.0
51-
- Ruby 2.7
52-
- TruffleRuby 22.0.0+
53+
- TruffleRuby 24.0.0+
5354
- JRuby 9.4+ (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
5455

5556
### Ruby on Rails
@@ -91,12 +92,11 @@ Feature: Rule Sample
9192
Given this will fail
9293
When I do an action
9394
Then some results should be there
94-
9595
```
9696

9797
### Automate your specification
9898

99-
And a file named `steps.rb` in `features/step_definitions` with:
99+
And a file named `rule_steps.rb` in `features/step_definitions` with:
100100

101101
```ruby
102102
# features/step_definitions/steps.rb
@@ -149,4 +149,4 @@ You can also find documentation on the command line possibilities in [features/d
149149

150150
## Copyright
151151

152-
Copyright (c) Cucumber Ltd. and Contributors. See LICENSE for details.
152+
Copyright (c) Cucumber and Contributors. See LICENSE for details.

RELEASING.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
11
See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md).
2-
3-
## When done ##
4-
5-
Update the cucumber-ruby version in the documentation project:
6-
7-
* https://github.com/cucumber/docs.cucumber.io
8-
9-
The cucumber-ruby version for the docs is specified in the docs [versions.yaml](https://github.com/cucumber/docs.cucumber.io/blob/master/data/versions.yaml)
10-
11-
All done! Hurray!

compatibility/features/attachments/attachments_steps.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ def cck_asset_path
2525
attach(data, media_type)
2626
end
2727

28+
# To be removed in CCK v19 alongside removing duplicate scenarios: https://github.com/cucumber/compatibility-kit/pull/127
2829
When('a JPEG image is attached') do
2930
attach(File.open("#{cck_asset_path}/cucumber.jpeg"), 'image/jpeg')
3031
end
3132

33+
# To be removed in CCK v19 alongside removing duplicate scenarios: https://github.com/cucumber/compatibility-kit/pull/127
3234
When('a PNG image is attached') do
3335
attach(File.open("#{cck_asset_path}/cucumber.png"), 'image/png')
3436
end
3537

3638
When('a PDF document is attached and renamed') do
37-
attach(File.open("#{cck_asset_path}/document.pdf"), 'document/pdf', 'renamed.pdf')
39+
attach(File.open("#{cck_asset_path}/document.pdf"), 'application/pdf', 'renamed.pdf')
3840
end
3941

4042
When('a link to {string} is attached') do |link|
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
def cck_asset_path
4+
"#{Gem.loaded_specs['cucumber-compatibility-kit'].full_gem_path}/features/examples-tables-attachment"
5+
end
6+
7+
When('a JPEG image is attached') do
8+
attach(File.open("#{cck_asset_path}/cucumber.jpeg"), 'image/jpeg')
9+
end
10+
11+
When('a PNG image is attached') do
12+
attach(File.open("#{cck_asset_path}/cucumber.png"), 'image/png')
13+
end

0 commit comments

Comments
 (0)