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

Intellij - Running specific scenarios in a feature file in a multi module karate project runs with the wrong karate version #2308

Closed
pavinil opened this issue May 2, 2023 · 3 comments

Comments

@pavinil
Copy link

pavinil commented May 2, 2023

example project - https://github.com/pavinil/karate-multi-module
Background - I am tasked with migrating a fairly large karate api testing project from version 0.9.6 to 1.4.0. This project is currently a single maven module that has separate folders for testing around 10 different services. Separate teams work on specific folders, adding tests for the services that they test. It uses Karate version 0.9.6
Migrating all services to 1.4.0 at once is currently not feasible as multiple teams are involved. One solution was to convert the project to a multi module project, with each module using its own version of karate.
The multi module approach works with one execption. Running individual scenarios using Intellij always uses the latest version of karate (1.4.0), even when that module(in which the feature file lives) is configured to use an older version. This issue does not occur when triggering all tests from the runner file.
In the attached example, service A uses version 0.9.6, while service B uses version 1.4.0. Clicking the run button next to serviceA.feature runs the scenario using version 1.4.0, instead of 0.9.6
image
Intellij Plugin version - 1.7.4.325
Intellij version - 2022.2.2 Community

@ptrthomas
Copy link
Member

cc @jansorg

@pavinil 0.9.6 is such an old version that I don't think we can support this use-case for now, but we can check.

in the meantime, the workaround I suggest is that you use "throwaway" JUnit runners to run features, scenarios, etc. and you have all the flexibility of setting tags, etc if needed.

if you use JUnit5 you can have multiple entry-points in one JUnit file, like this example - and you should be able to run one at a time using IntelliJ-s JUnit integration. of course using the Runner API from any Java class (even a main method) is an option

@pavinil
Copy link
Author

pavinil commented May 2, 2023

@ptrthomas Thank you for agreeing to check on this. This will really help in making our migration feel seamless. Meanwhile, I will try your suggested workaround and report back.

@ptrthomas
Copy link
Member

this is closed as a duplicate of the intellij plugin issue: karatelabs/intellij-plugin#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants