Quarkus: [gradle] gradle test still not work

Created on 17 Aug 2019  ·  43Comments  ·  Source: quarkusio/quarkus

quarkus version: 0.21.1

rep: https://github.com/qwlabs/quarkus-issues/tree/master/2019-06-21-21-00

run ./gradlew test

console error log

$./gradlew test

> Task :test FAILED

quarkus.modern.gradle.example.UserResourceTest > testHelloEndpoint() FAILED
    org.junit.jupiter.api.extension.TestInstantiationException
        Caused by: java.lang.IllegalStateException
            Caused by: io.quarkus.bootstrap.BootstrapException

1 test completed, 1 failed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/pipinet/qwlabs/quarkus-issues/2019-06-21-21-00/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
4 actionable tasks: 1 executed, 3 up-to-date

test report error log

org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [quarkus.modern.gradle.example.UserResourceTest]: Failed to create the boostrap class loader
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstanceFactory(ClassBasedTestDescriptor.java:298)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:273)
    at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:70)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:256)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:250)
    at java.util.Optional.orElseGet(Optional.java:267)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:249)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:29)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:106)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:105)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:69)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy2.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Failed to create the boostrap class loader
    at io.quarkus.test.junit.QuarkusTestExtension.createQuarkusBuildClassLoader(QuarkusTestExtension.java:293)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:78)
    at io.quarkus.test.junit.QuarkusTestExtension.createTestInstance(QuarkusTestExtension.java:343)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstanceFactory(ClassBasedTestDescriptor.java:283)
    ... 72 more
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to locate project pom.xml for /Users/pipinet/qwlabs/quarkus-issues/2019-06-21-21-00/build/classes/java/main
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.locateCurrentProjectDir(LocalProject.java:113)
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace(LocalProject.java:43)
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace(LocalProject.java:39)
    at io.quarkus.bootstrap.BootstrapClassLoaderFactory.newDeploymentClassLoader(BootstrapClassLoaderFactory.java:268)
    at io.quarkus.test.junit.QuarkusTestExtension.createQuarkusBuildClassLoader(QuarkusTestExtension.java:291)
    ... 75 more

aregradle kinbug triagout-of-date

Most helpful comment

No worries. I have a workaround :)

I just felt it was best behavior to report new insights on an issue that appeared to be stale.

All 43 comments

I will take it, could you assign me please ?

update: forget this, the boostrap project don't need to manage gradle because gradle propose the CP by system properties. It seems in this the system properties is missing or empty.

I wait some input from @aloubyansky @gsmet because. I can do it simply in bootstap project by adding gradle dep. But maybe you want a bigger refactor to split maven and gradle dependence in sub project ?

I reproduce the error in 0.21.1 but not in 999-SNAPSHOT:

diff --git a/2019-06-21-21-00/build.gradle b/2019-06-21-21-00/build.gradle
index 69202e1..35d8295 100644
--- a/2019-06-21-21-00/build.gradle
+++ b/2019-06-21-21-00/build.gradle
@@ -1,15 +1,26 @@
+buildscript {
+    repositories {
+        mavenLocal()
+    }
+    dependencies {
+        classpath "io.quarkus:quarkus-gradle-plugin:999-SNAPSHOT"
+    }
+}
+
 plugins {
     id 'java'
     id 'idea'
-    id 'io.quarkus' version '0.21.1'
 }

+apply plugin: 'io.quarkus'
+
 compileJava.options.encoding = "UTF-8"
 compileTestJava.options.encoding = "UTF-8"

 repositories {
     jcenter()
     mavenCentral()
+    mavenLocal()
 }

 dependencies {
@@ -26,5 +37,5 @@ dependencies {

 test {
     useJUnitPlatform()
-    forkEvery 1
+ forkEvery 1
 }
diff --git a/2019-06-21-21-00/gradle.properties b/2019-06-21-21-00/gradle.properties
index 69b7691..5a989a5 100644
--- a/2019-06-21-21-00/gradle.properties
+++ b/2019-06-21-21-00/gradle.properties
@@ -1,6 +1,6 @@
 group=quarkus.issue
 version=0.1

-quarkus_version=0.21.1
+quarkus_version=999-SNAPSHOT
 resteasy_version=4.0.0.Final
 rest_assured_version=3.3.0
diff --git a/2019-06-21-21-00/settings.gradle b/2019-06-21-21-00/settings.gradle
index e50c6d2..c9e55eb 100644
--- a/2019-06-21-21-00/settings.gradle
+++ b/2019-06-21-21-00/settings.gradle
@@ -7,7 +7,7 @@ pluginManagement {
     resolutionStrategy {
         eachPlugin {
             if (requested.id.id == 'io.quarkus') {
-                useModule("io.quarkus:quarkus-gradle-plugin:${requested.version}")
+                useModule("io.quarkus:quarkus-gradle-plugin:999-SNAPSHOT")
             }
         }
     }

As I can see the error in 0.21.1 is because the "quarkus-deployment-cp" properties containing the class path is not set or empty by the Quarkus gradle plugin. The default treatement try to calculate the classpath on a maven plugin.

There is one remaining error after:
Expected status code <200> but was <415>

It's strange, I must debug a little more.

@Dufgui sorry, 415 is right, resource is post , but test is get.

Ok so wait for next release please. Can you close this issue?

Hold on closing it. Is it fixed in master?

It appears Gradle is not applying the Quarkus plugin in your config. If you change it like @Dufgui suggested it will work with 0.21.1. The test will fail as noted but the plugin will be working correctly.

Just in case, I tested with the following changes
````
diff --git a/2019-06-21-21-00/build.gradle b/2019-06-21-21-00/build.gradle
index 69202e1..3c7c709 100644
--- a/2019-06-21-21-00/build.gradle
+++ b/2019-06-21-21-00/build.gradle
@@ -1,13 +1,24 @@
+buildscript {

  • repositories {
  • mavenLocal()
  • }
  • dependencies {
  • classpath "io.quarkus:quarkus-gradle-plugin:${quarkus_version}"
  • }
    +}
    +
    plugins {
    id 'java'
    id 'idea'
  • id 'io.quarkus' version '0.21.1'
    }

+apply plugin: 'io.quarkus'
+
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

repositories {
+ mavenLocal()
jcenter()
mavenCentral()
}
diff --git a/2019-06-21-21-00/settings.gradle b/2019-06-21-21-00/settings.gradle
index e50c6d2..05dd366 100644
--- a/2019-06-21-21-00/settings.gradle
+++ b/2019-06-21-21-00/settings.gradle
@@ -7,7 +7,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == 'io.quarkus') {
- useModule("io.quarkus:quarkus-gradle-plugin:${requested.version}")
+ useModule("io.quarkus:quarkus-gradle-plugin:${quarkus_version}")
}
}
}
````

Maybe we could add a log to see if the plugin is well loaded and called

Le mar. 20 août 2019 à 10:22, Alexey Loubyansky notifications@github.com
a écrit :

Just in case, I tested with the following changes

diff --git a/2019-06-21-21-00/build.gradle b/2019-06-21-21-00/build.gradle
index 69202e1..3c7c709 100644
--- a/2019-06-21-21-00/build.gradle
+++ b/2019-06-21-21-00/build.gradle
@@ -1,13 +1,24 @@
+buildscript {

  • repositories {
  • mavenLocal()
  • }
  • dependencies {
  • classpath "io.quarkus:quarkus-gradle-plugin:${quarkus_version}"
  • }
    +}
    +
    plugins {
    id 'java'
    id 'idea'
  • id 'io.quarkus' version '0.21.1'
    }

+apply plugin: 'io.quarkus'
+
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

repositories {
+ mavenLocal()
jcenter()
mavenCentral()
}
diff --git a/2019-06-21-21-00/settings.gradle b/2019-06-21-21-00/settings.gradle
index e50c6d2..05dd366 100644
--- a/2019-06-21-21-00/settings.gradle
+++ b/2019-06-21-21-00/settings.gradle
@@ -7,7 +7,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == 'io.quarkus') {
- useModule("io.quarkus:quarkus-gradle-plugin:${requested.version}")
+ useModule("io.quarkus:quarkus-gradle-plugin:${quarkus_version}")
}
}
}


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/3552?email_source=notifications&email_token=AABZ5G2MYSJYVXNTIF3G333QFOSTDA5CNFSM4IMPF4XKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4VPMIA#issuecomment-522909216,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABZ5G26YJSGRO3YLXZIJCDQFOSTDANCNFSM4IMPF4XA
.

It's not applied. Its tasks are not listed for the build. I think we should create a minimal reproducer and open a Gradle issue.

According to my tests, the plugins block fail, the apply works.
The plugins is a new feature:
https://stackoverflow.com/questions/32352816/what-the-difference-in-applying-gradle-plugin

It's not clear if the local repo is compliant with this syntax.
https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block

maybe we must publish in gradle portal
https://github.com/quarkusio/quarkus/issues/1793

I try to publish the snapshot version to test it and remove it after but I must wait an approval from gradle portal

Our plugin is not the Gradle plugins repo, so we should be sticking to apply.

The publication in gradle portal of a temporary version, doesn't change anything. We are stick to apply :(

Hey guys, I've been watching several issues concerning "gradle test" (with annotation '@QuarkusTest') and can confirm that version "0.21.1" works by adding the plugin in the legacy format. Here's a quick example of my build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.quarkus:quarkus-gradle-plugin:0.21.1'
    }
}

plugins {
    id 'java'
}

apply plugin: 'io.quarkus'

group 'ch.example'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {

    testImplementation enforcedPlatform('io.quarkus:quarkus-bom:0.21.1')
    testImplementation 'io.quarkus:quarkus-junit5'
    testImplementation 'io.rest-assured:rest-assured:3.3.0'
    testImplementation 'org.apache.maven.plugins:maven-surefire-plugin:2.22.1'

    implementation enforcedPlatform('io.quarkus:quarkus-bom:0.21.1')
    implementation 'io.quarkus:quarkus-resteasy-jsonb'
    implementation 'io.quarkus:quarkus-smallrye-openapi'
    implementation 'io.quarkus:quarkus-agroal'
    implementation 'io.quarkus:quarkus-jdbc-h2'
    implementation 'io.quarkus:quarkus-hibernate-orm-panache'
}

test {
    useJUnitPlatform()
}

It might be more useful to adjust the gradle guide and make it more clear for new users. I think the title Gradle configuration for a local SNAPSHOT version of Quarkus is confusing and might make new users skip that section. Although the sentence after the title describes that this solution works for both local and official versions of the quarkus plugin. Not sure of the details and if this solution is only temporary. But since I got my tests working, I'm willing to deep diver into quarkus.

Excellent, thanks you @geekrumper. We'll take your suggestion into account. BTW, feel free to create github issues and possibly PRs ;) where you see a fix or an improvement is needed.

@aloubyansky thank you for the heads up... Next time, I'll consider making a PR.

I let other people rewrite the doc, every time l haved try, i remember my english sucks.

@pipinet have you seen the solution from @geekrumper? This works perfectly for me.

I'm not sure exactly what the behaviour is for apply(...) vs the plugins {} block, but the behaviour I observed when using plugins {} is that older Quarkus artifacts were being used (and not the version I requested).

Using apply(...) seems to make everything get pulled in correctly.

still not work in 0.24.0

I still have problems with my tests running on 0.26.1.

This morning I spent some time trying to find the cause of it.

What I see is:

org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [accepttest.dns.websocket.event.EventOnDnsQueryTest]: Failed to create the boostrap class loader
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstanceFactory(ClassBasedTestDescriptor.java:300)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:275)
...
Caused by: java.lang.IllegalStateException: Failed to create the boostrap class loader
    at io.quarkus.test.junit.QuarkusTestExtension.createQuarkusBuildClassLoader(QuarkusTestExtension.java:334)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:92)
    at io.quarkus.test.junit.QuarkusTestExtension.createTestInstance(QuarkusTestExtension.java:390)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstanceFactory(ClassBasedTestDescriptor.java:285)
    ... 72 more
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to locate project pom.xml for /opt/sources/eclipse.git/dns-filter/build/classes/java/main
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.locateCurrentProjectDir(LocalProject.java:113)
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace(LocalProject.java:43)
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace(LocalProject.java:39)
    at io.quarkus.bootstrap.BootstrapClassLoaderFactory.newDeploymentClassLoader(BootstrapClassLoaderFactory.java:268)
    at io.quarkus.test.junit.QuarkusTestExtension.createQuarkusBuildClassLoader(QuarkusTestExtension.java:332)

I tried to create a simple project and that did not display the problem.
So I tried trimming down my regular project to find the cause.

Turns out that the class bootstrap only works, if the unit tests are executed in the context of the Gradle task 'test'.
I run my acceptance tests (those acually using @QuarkusTest annotation) from a task like this:

task acceptTest(type: Test) {
    useJUnitPlatform {
        includeTags "accept"
    }
    ignoreFailures = true

    environment("GRADLE_TEST", "true")
    forkEvery 1
}

And this fails as described above.
If I run the same unit tests from the 'test' task, they work fine.

I see the same error and i guess it aligns with the comment by @jskov. When running it as "gradle check" on the commandline, tests are executed. when running the test from within eclipse, i get the exception.

@maxandersen are you planning on looking at this one? I don't use eclipse so I don't think I can do much about it

Not (only) related to eclipse, btw. This is (also) a problem from Gradle command line.

@jskovjyskebankdk which command did you is not working?

Asking because the are various fixes for the gradle tasks that have gone in lately

See https://github.com/quarkusio/quarkus/issues/3552#issuecomment-546586969, tested with 0.26.1

@QuarkusTest only works when executed in context of the Gradle task named 'test'.
They fail if you use a custom instance called e.g. 'integration'.

@jskovjyskebankdk I see. Starting with Quarkus 0.26.1 you can generate a Gradle project using the Maven tooling (see this) which sets up 2 different tasks for tests.
I propose you take a look and tell us what you think.

I am not having problems writing Gradle.
The problem is that the quarkus plugin makes assumptions about what tasks are relevant for testing, based on naming (it would seem - this is not a comprehensive bug analysis :) )
It should do so based on task types.

@jskovjyskebankdk I understand where you are coming from.
However the plugin now sets up the necessary tasks on it's own so you shouldn't need to manually configure them anymore.
That said, having custom test tasks will probably not work at this point.

@jskovjyskebankdk sorry for the troubles. we've found a few bad assumptions in the gradle task implementation that we'll need to fix to make it more solid - this is one of them; but it will be post 1.0. Very shortly after is my plan.

No worries. I have a workaround :)

I just felt it was best behavior to report new insights on an issue that appeared to be stale.

thanks @jskovjyskebankdk - you are totally correct and its most appreciated!

i remove gradle idea plugin. works.

i remove gradle idea plugin. works.

which plugin to be exact ?

idea

open gralde project with project folder, not .ipr file

@pipinet I'm not fully following you. Are you saying that you removed intellij gradle plugin then things started working for you ?

Your comment about "open gradle project with project folder" i don't understand - intellij will use .ipr if that is found in your folder...can you elaborate a bit more ?

1、gradle test not working in command line
fix: remove idea plugin https://docs.gradle.org/current/userguide/idea_plugin.html

2、test not working in IntelliJ IDEA
fix: remove .ipr file that generated by ./gradlew idea command

@pipinet got it - I wonder what "evil" idea plugin does to confuse the test runs...

To clarify, is there still something to fix in Quarkus here?

No, I think it has been landed OK.

Excellent. In case somebody else here still believes not everything has been addressed, please open a new issue. Thanks everyone.

Was this page helpful?
0 / 5 - 0 ratings