kirksl / karate-runner

VSCode Extension for Karate
https://marketplace.visualstudio.com/items?itemName=kirkslota.karate-runner
MIT License
34 stars 11 forks source link

Karate Runner doesn't work in 1.5.0.RC3 #192

Closed vladislav-sroa closed 7 months ago

vladislav-sroa commented 7 months ago

After the update to the Karate 1.5.0.RC3 and Maven group-id for junit5, when running the tests using the runner, there is the following error:


java.lang.ClassNotFoundException: com.intuit.karate.cli.Main
    at org.codehaus.mojo.exec.URLClassLoaderBuilder$ExecJavaClassLoader.loadClass (URLClassLoaderBuilder.java:198)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:526)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:271)
    at java.lang.Thread.run (Thread.java:1583)

    The terminal process "/bin/zsh '-l', '-c', 'mvn clean test-compile -f "/Users/vladislav.vizitiu/SROA/bdd-portal-api/pom.xml" exec:java -Dexec.mainClass="com.intuit.karate.cli.Main"```

    Running tests using `mvn test..` runs tests successfully.
kirksl commented 7 months ago

@vladislav-sroa Please let us know if you can reproduce this issue with our sample project https://github.com/kirksl/karate-maven-gradle

vladislav-sroa commented 7 months ago

Unfortunately I'm not able to run the project using the Runner: zsh:1: permission denied: ./mvnw

kirksl commented 7 months ago

From the root of the project run chmod +x ./mvnw first

vladislav-sroa commented 7 months ago

user karate-maven-gradle % chmod +x ./mvnw first chmod: first: No such file or directory

kirksl commented 7 months ago

I'm not quite sure what you ran I would try these commands on a linux command line

git clone https://github.com/kirksl/karate-maven-gradle.git
cd karate-maven-gradle
chmod +x ./mvnw
vladislav-sroa commented 7 months ago

I used all the same, except for the command chmod... I inserted first word as well. I have some trouble running the project, since I need to change some paths and cannot locate them.

[INFO] -------------------------------------------------------------
[ERROR] /Users/vladislav.vizitiu/SROA/karate-maven-gradle/src/test/java/MockSpringMvcServlet.java:[1,38] package com.intuit.karate.mock.servlet does not exist
[ERROR] /Users/vladislav.vizitiu/SROA/karate-maven-gradle/src/test/java/KarateHook.java:[36,44] cannot find symbol
  symbol:   variable feature
  location: variable fr of type com.intuit.karate.core.FeatureRuntime
[ERROR] /Users/vladislav.vizitiu/SROA/karate-maven-gradle/src/test/java/RPReporter.java:[233,44] cannot find symbol
  symbol:   method getScenarioCount()
  location: variable s of type com.intuit.karate.core.FeatureResult
[ERROR] /Users/vladislav.vizitiu/SROA/karate-maven-gradle/src/test/java/RPReporter.java:[252,26] cannot find symbol
  symbol:   method getScenarioCount()
  location: variable featureResult of type com.intuit.karate.core.FeatureResult
[ERROR] /Users/vladislav.vizitiu/SROA/karate-maven-gradle/src/test/java/MockSpringMvcServlet.java:[53,20] cannot find symbol
  symbol:   class MockHttpClient
  location: class MockSpringMvcServlet```

  This dependency changed from `com.intuit.karate` to `io.karatelabs` that is needed for the new 1.5.0.RC3 version.
  All the changes for the newer version are listed below
<properties>
    <java.version>21</java.version>
    <karate.version>1.5.0.RC3</karate.version>
</properties>
io.karatelabs karate-junit5 ${karate.version} test ```
kirksl commented 7 months ago

This looks related to Karate and their dependencies and not Karate Runner I would recommend opening an issue and discussing with them at https://github.com/karatelabs/karate/issues

vladislav-sroa commented 7 months ago

I actually did reach out to them first. Have you tried upgrading the Karate version and running the tests ?

kirksl commented 7 months ago

We have. Starting with Karate 1.4.1 it seems like Karate is starting to require a subscription. I would advise using their VSCode plugin if you need a version greater than 1.4.0. Karate Runner should continue to work with Karate less than 1.4.1.

kirksl commented 7 months ago

@vladislav-sroa Closing as this doesn't appear to be an issue with Karate Runner.

vladislav-sroa commented 3 months ago

Hello, wanted to follow-up and find out if there will be no updates on the karate-runner to support the newer versions of Karate ? Thank you in advance!

kirksl commented 3 months ago

Hi @vladislav-sroa Appreciate your interest in continuing to use karate-runner plugin. Is there a reason you would prefer to use our plugin vs using Karate Labs plugin which supports newer versions?

vladislav-sroa commented 3 months ago

The official plugin is not a free one, that is the main reason Im still using yours. It is good for my needs, but unfortunately now I have an issue that after the newer version, not able to run the tests.

kirksl commented 3 months ago

I would advise continuing to use an older version of Karate if you want to keep everything free. Unfortunately, even when we attempt to integrate karate-runner with newer versions of Karate, the requirement to pay occurs as it's really their backend code enforcing this.

vladislav-sroa commented 3 months ago

Oh, that is how it works right now. The newer version has some bugs fixed. I understand that now I must choose my destiny :) Thank you for your support.

vladislav-sroa commented 3 months ago

One more thing that I've noticed recently that when I'm running the test from the runner it won't pick up the @BeforeAll annotation from the runner class, to run a sql script. Running tests with mvn test performs as expected. Any idea, where should I look into ?

Screenshot 2024-07-25 at 4 01 06 PM

kirksl commented 3 months ago

Would you mind creating a branch reproducing this issue with our sample project https://github.com/kirksl/karate-maven-gradle

I'd be happy to pull down the branch and look into it