Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Update Cucumber #2877

Merged
merged 6 commits into from
Sep 13, 2021
Merged

Update Cucumber #2877

merged 6 commits into from
Sep 13, 2021

Conversation

mvz
Copy link
Contributor

@mvz mvz commented Feb 28, 2021

Cucumber 3.2 is the last version that combines the following two properties:

  • It supports Ruby 2.3
  • It supports installation together with diff-lcs 1.4.4

This pull requests fixes the errors when running with Cucumber 2.x and up by improving the handler for the @ruby-2-7 tag so it uses Cucumber's standard support for skipping scenarios.

Sibling PRs:

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to overload the 4.0 release, I thought of doing this after.

Do you mind to hold off for a while? We've just two PRs left in Core, and add deprecation messages all over repos for the functionality we've changed/removed. I think it will take roughly a month.

@mvz
Copy link
Contributor Author

mvz commented Feb 28, 2021

Not to overload the 4.0 release, I thought of doing this after.

Do you mind to hold off for a while? We've just two PRs left in Core, and add deprecation messages all over repos for the functionality we've changed/removed. I think it will take roughly a month.

Sure, I can wait until after the 4.0 release.

@pirj pirj changed the title Update Cucumber to version 3.2 Update Cucumber Sep 5, 2021
@pirj pirj force-pushed the update-cucumber branch 2 times, most recently from 019e32d to eeca7ed Compare September 5, 2021 14:25
@pirj
Copy link
Member

pirj commented Sep 5, 2021

Updated from 4-0-dev (rr dev dependency was bumped to 3.0).
Moved dev dependencies to Gemfile from gemspec.
Updated Cucumber further to 7.0.

@pirj pirj force-pushed the update-cucumber branch 3 times, most recently from cb95058 to 3d86a95 Compare September 5, 2021 14:57
@pirj pirj requested review from JonRowe and benoittgt September 5, 2021 15:01
@pirj
Copy link
Member

pirj commented Sep 5, 2021

JRuby failure is unrelated - bisect spec failure.

@pirj pirj added this to the Post 4.0 milestone Sep 7, 2021
@JonRowe
Copy link
Member

JonRowe commented Sep 7, 2021

Can we not still run the older cucumber on the older rubies?

@@ -44,7 +44,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['3']).join('.')}"
end

s.add_development_dependency "cucumber", "~> 1.3"
if RUBY_VERSION >= '2.5'
Copy link
Contributor Author

@mvz mvz Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic like this in the gemspec does not work since this will be evaluated at gem build time. This is probably going to be on a post-2.5 Ruby version, meaning the resulting gem will just build-depend on cucumber 7.

@@ -44,7 +44,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['3']).join('.')}"
end

s.add_development_dependency "cucumber", "~> 1.3"
if RUBY_VERSION >= '2.5'
s.add_development_dependency "cucumber", "~> 7.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would propose versioning the cucumber dependency as ">= 3.2", "< 8.0", and putting any extra logic needed in the Gemfile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should just be worked out based on the diff-lcs requirement and ruby version no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think those are basically the two inputs that would determine which cucumber versions will work.

This comment was marked as resolved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my bad, 4.x was incompatible due to diff-lcs, so we're fine.

I'll update rspec/rspec-expectations#1320 to work around ok? error on 3.2 somehow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, worked perfectly.

Fun fact: on Rubies 2.3, 2.4 and JRuby 9.1, Bundler installs cucumber 4.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun fact: on Rubies 2.3, 2.4 and JRuby 9.1, Bundler installs cucumber 4.0.0.

Oh, that's funny: Cucumber 4.0.1 disallows diff-lcs 1.4.4, but version 4.0.0 allows it. There must be some problem with diff-lcs 1.4 but it clearly isn't relevant here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.0.1's changelog mentions diff-lcs's breaking changes.

I've added "!= 4.0.0" to the specification to be on the safe side.
2.3, 2.4 and JRuby 9.1 builds will use Cucumber 3.2, while others will take the latest 7.x.

It's remarkable that Cucumber mentions to drop support for JRuby in 4.0 rc.

@pirj pirj force-pushed the update-cucumber branch 2 times, most recently from d5efa83 to 7c904b2 Compare September 11, 2021 14:14
@pirj
Copy link
Member

pirj commented Sep 11, 2021

I've removed my changes to build scripts. Cucumber > 4 < 8 installs and runs just fine across all versions that we test on CI.

cucumber 4.0.0 is not aware of breaking changes in diff-lcs 1.4.3, so
excluding it

cucumber 4.0.0 would run on Ruby 2.3, 2.4 and JRuby 9.1
@pirj pirj merged commit 60659b7 into rspec:4-0-dev Sep 13, 2021
@pirj
Copy link
Member

pirj commented Sep 13, 2021

@mvz Thank you!

@mvz mvz deleted the update-cucumber branch September 13, 2021 08:41
pirj added a commit to rspec/rspec-rails that referenced this pull request Sep 18, 2021
cucumber 4.0.0 is not aware of breaking changes in diff-lcs 1.4.3, so
excluding it

cucumber 3.2 would run on Ruby 2.2, 2.3 and 2.4

Sibling PRs:
 - rspec/rspec-core#2877
 - rspec/rspec-mocks#1439
 - rspec/rspec-expectations#1320
pirj added a commit to rspec/rspec-rails that referenced this pull request Sep 18, 2021
cucumber 4.0.0 is not aware of breaking changes in diff-lcs 1.4.3, so
excluding it

cucumber 3.2 would run on Ruby 2.2, 2.3 and 2.4

Sibling PRs:
 - rspec/rspec-core#2877
 - rspec/rspec-mocks#1439
 - rspec/rspec-expectations#1320
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants