Skip to content

jamailun/karate-quarkus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Karate/quarkus

With dichotomy, I could find the release which broke the Karate framework : 3.8.5.

The Quarkus PR #39442 excluded org.graalvm.polyglot:polyglot from the Graal-SDK.

But reimporting it does not seem to work.

Update 02/12/2024

After upgrading to Quarkus 3.16, Karate broke again.

After further inspection, it has been fixed in this karate commit.

So I've shaded the depedency (because no snapshot of karate 1.5.1 has still been published)à.

Update 20/09/2024

Karate upgraded to 1.5.0. With the latest version of Quarkus, the test still do not seem to work.

Now, with Quarkus 3.14.4 we don't have any error, ... but the Karate tests are NOT performed.

Again, it works well with Quarkus 3.8.2 + Karate 1.4.1, but not after.

Update 02/10/2024

The Karate#relativeTo(Class<?>) was not working.

So I created a custom method using a Reflections 0.9.9-RC1. Thanks to this Stackoverflow answer.

The bad new is Truffle and Polyglot do not have the same version Karate 1.5.0 dependency. So we have to use an env var : -Dpolyglotimpl.DisableVersionChecks=true.


Previous issue

The issue

Because the Graal SDK was excluded, Karate causes this issue :

java.lang.NoClassDefFoundError: org/graalvm/polyglot/Value
        at com.intuit.karate.core.Variable.<init>(Variable.java:72)
        at com.intuit.karate.core.Variable.<clinit>(Variable.java:66)
        at com.intuit.karate.core.Config.<init>(Config.java:94)
        at com.intuit.karate.core.ScenarioCall.getParentConfig(ScenarioCall.java:67)
        at com.intuit.karate.core.ScenarioRuntime.<init>(ScenarioRuntime.java:74)
        at com.intuit.karate.core.ScenarioIterator.tryAdvance(ScenarioIterator.java:162)
        ...

Potential fixes

1) Adding Graal-SDK :

We add the graal-sdk dependency.

<dependency>
  <groupId>org.graalvm.sdk</groupId>
  <artifactId>graal-sdk</artifactId>
  <version>22.3.3</version>
</dependency>

New exception : ServiceConfiguration org.graalvm.polyglot.impl.AbstractPolyglotImpl: com.oracle.truffle.polyglot.PolyglotImpl not a subtype

java.util.ServiceConfigurationError: org.graalvm.polyglot.impl.AbstractPolyglotImpl: com.oracle.truffle.polyglot.PolyglotImpl not a subtype
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
        at org.graalvm.polyglot.Engine$1.searchServiceLoader(Engine.java:918)
        at org.graalvm.polyglot.Engine$1.run(Engine.java:900)
        at org.graalvm.polyglot.Engine$1.run(Engine.java:894)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at org.graalvm.polyglot.Engine.initEngineImpl(Engine.java:894)
        at org.graalvm.polyglot.Engine$ImplHolder.<clinit>(Engine.java:139)
        at org.graalvm.polyglot.Engine.getImpl(Engine.java:363)
        at org.graalvm.polyglot.Engine$Builder.build(Engine.java:621)
        at com.intuit.karate.graal.JsEngine.createContext(JsEngine.java:73)
        at com.intuit.karate.graal.JsEngine$1.initialValue(JsEngine.java:65)
        at com.intuit.karate.graal.JsEngine$1.initialValue(JsEngine.java:62)
        at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:225)
        at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:194)
        at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
        at com.intuit.karate.graal.JsEngine.global(JsEngine.java:93)
        at com.intuit.karate.core.Tags.evaluate(Tags.java:156)
        at com.intuit.karate.core.ScenarioRuntime.isSelectedForExecution(ScenarioRuntime.java:344)
        at com.intuit.karate.core.ScenarioRuntime.<init>(ScenarioRuntime.java:108)
        at com.intuit.karate.core.ScenarioIterator.tryAdvance(ScenarioIterator.java:162)
        ...

Which is weird, because the class com.oracle.truffle.polyglot.PolyglotImpl does inherit org.graalvm.polyglot.impl.AbstractPolyglotImpl

Link to Truffle class source code.

Only adding the new polyglot module

Instead of the previous fix, we add:

<dependency>
    <groupId>org.graalvm.polyglot</groupId>
    <artifactId>polyglot</artifactId>
    <version>24.0.1</version>
</dependency>

Now it compiles ! But karate won't find anything, even though the tests are the sames.

org.opentest4j.AssertionFailedError: no features or scenarios found: [classpath:org/jamailun]
        at com.intuit.karate.junit5.Karate.iterator(Karate.java:72)
        ...

About

Small demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published