Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider cucumber-java8 for deprecation #2174

Open
2 tasks
mpkorstanje opened this issue Dec 3, 2020 · 13 comments
Open
2 tasks

Consider cucumber-java8 for deprecation #2174

mpkorstanje opened this issue Dec 3, 2020 · 13 comments
Labels
💔 breaking change This will require a major release
Milestone

Comments

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Dec 3, 2020

Update: With jhalterman/typetools#66 released we can hold off on deprecation until #2279 is resolved. Deprecation is still considered to ensure all step definition are static.

Original:

cucumber-java8 does not work on OpenJDK 12+. The Cucumber team does not have the time and people available to make cucumber-java8 work on OpenJDK 12+ so we are deprecating the module for removal.

This will also result in the removal of ScenarioScoped glue which will allow us to improve the caching mechanism used to match steps to regular expressions (#2035).

  • v8.0.0 deprecate cucumber-java8
  • v9.0.0 remove cucumber-java8
@mpkorstanje mpkorstanje added this to the v6.x.x milestone Dec 3, 2020
@mpkorstanje mpkorstanje changed the title Deprecate cucumber-java8 Deprecate and remove cucumber-java8 Dec 3, 2020
@JB99928
Copy link

JB99928 commented Dec 4, 2020

@mpkorstanje what should be used as an alternative to cucumber-java8 to run on later versions of the JDK?

@mpkorstanje
Copy link
Contributor Author

You can still use cucumber-java.

@mpkorstanje mpkorstanje modified the milestones: v6.x.x, 7.0.0 Dec 10, 2020
@aslakhellesoy aslakhellesoy added 💔 breaking change This will require a major release 🔧 build Related to build / release process labels Feb 2, 2021
@mpkorstanje mpkorstanje removed the 🔧 build Related to build / release process label Feb 13, 2021
@ragsp21
Copy link

ragsp21 commented Mar 1, 2021

@mpkorstanje I'm a bit thick today. That means that going forward we won't be able to use cucumber-java-8 for any java version (12+ and less than 12)?

@mpkorstanje
Copy link
Contributor Author

mpkorstanje commented Mar 1, 2021

Currently v6 of cucumber-java8 does not work with Java 12+.

Unless something changes the following will be true at some point in the future:

  • In v7 cucumber-java8 will be deprecated. You'll get a warning from your Compiler and IDE about this. But you can continue to use cucumber-java8 with Java 8,9.10,11.
  • Starting with v8 cucumber-java8 will be removed. From this version onwards can not use cucumber-java8.

So if you wish to upgrade to Java 12 (presently) or Cucumber v8 (at some point in the future) you can not use cucumber-java8.

@mpkorstanje
Copy link
Contributor Author

With jhalterman/typetools#66 released we can hold off on deprecation until #2279 is resolved. Deprecation is still considered to ensure all step definition are static.

@theotherp
Copy link

One positive aspect of lambda step definitions is that you can bundle them in several methods and that it's a loss less verbose. You need half as much space for them and if you have a couple of them that group together but not enough to put them into their own classes just put them into a method that's called from the constructor.

@fbus
Copy link

fbus commented Apr 25, 2022

Hello typetool 0.6.3 contains the fix for java12+. Is this bug still relevant ?

@mpkorstanje
Copy link
Contributor Author

@fbus

With jhalterman/typetools#66 released we can hold off on deprecation until #2279 is resolved. Deprecation is still considered to ensure all step definition are static.

@fbus
Copy link

fbus commented Apr 27, 2022

Ok I kind of understand the motivation for removal. That's unfortunate because I prefer that DSL.
For what it's worth, i can confirm that placing that dependency is enough to fix the error:

       <dependency>
            <groupId>net.jodah</groupId>
            <artifactId>typetools</artifactId>
            <version>0.6.3</version>
	    <scope>test</scope>
        </dependency>

@timtebeek
Copy link
Contributor

Once cucumber-java8 is deprecated, users will have to migrate to (most likely) cucumber-java. Perhaps a tool like OpenRewrite & rewrite-testing-frameworks can be used to convert users automatically. I have some experience with the tool, but can't commit much time to it yet due to travel plans. Thought to mention it here in case anyone wants to make a head start.

@simonstratmann
Copy link

I wrote a (kinda hacky) IntelliJ plugin to convert a couple of thousand step definitions from lambda to methods. I might be able to provide the code although it's mostly IntelliJ specific.

@timtebeek
Copy link
Contributor

Implemented a migration recipe through OpenRewrite here: https://github.com/openrewrite/rewrite-testing-frameworks/tree/main/src/main/java/org/openrewrite/java/testing/cucumber
This converts the most common use cases such as Before/After hooks and any language specific step definitions to cucumber-java.

It has some limitations currently around method references and data tables that I didn't include yet, but should be possible to add those still. Anyone welcome to join the effort, as I don't have an immediate need for those migrations.

Applied successfully to migrate 20 work projects, and think this approach will scale to accommodate users when cucumber-java8 is indeed deprecated.

I intend to write this up into a company blogpost, but imagine it would fit in well with the release notes and migration guide here as well. Let me know if any help in that area is required.

@timtebeek
Copy link
Contributor

Quick update here: the migration recipes will move to cucumber/cucumber-jvm-migration#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💔 breaking change This will require a major release
Projects
None yet
Development

No branches or pull requests

8 participants