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

gradle testNative ignores *IT tests #4881

Closed
gastaldi opened this issue Oct 25, 2019 · 8 comments
Closed

gradle testNative ignores *IT tests #4881

gastaldi opened this issue Oct 25, 2019 · 8 comments
Labels
triage/invalid This doesn't seem right

Comments

@gastaldi
Copy link
Contributor

Describe the bug
When I run gradle testNative in a Quarkus Gradle project, the NativeGreetingResourceIT test is not executed.

Expected behavior
IT test is executed

Actual behavior
It is not executed. It does execute if I rename to NativeGreetingTest.

To Reproduce
Steps to reproduce the behavior:
1.

mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=org.acme -DprojectArtifactId=foo -DclassName="org.acme.quickstart.GreetingResource" -Dpath="/hello" -Dextensions="resteasy" -DbuildTool=gradle
  1. gradle buildNative --docker-build=true testNative

Additional context
If I rename the test inside the native-test directory to NativeGreetingResourceTest it works

@gastaldi gastaldi added the kind/bug Something isn't working label Oct 25, 2019
@geoand
Copy link
Contributor

geoand commented Oct 26, 2019

Weird... I specifically remember seeing tests being run and failing. Do you have a fix ready or should I take a look at it?

@gastaldi gastaldi added the good first issue Good for newcomers label Oct 26, 2019
@gastaldi
Copy link
Contributor Author

Nope, it's up for grabs :) BTW have you been able to reproduce it using the steps I mentioned above?

@geoand
Copy link
Contributor

geoand commented Oct 26, 2019

I'll give it a shot and let you know

@geoand
Copy link
Contributor

geoand commented Oct 26, 2019

I can see the tests being executed (basically what I did is change the code to make the test fail and it did as expected).
What makes you think they don't run?

@gastaldi
Copy link
Contributor Author

If you look at #4579, the NativeGreetingResourceTest is not displayed in the console if you rename it to NativeGreetingResourceIT

@geoand
Copy link
Contributor

geoand commented Oct 26, 2019

I executed: ./gradlew clean buildNative --docker-build=true testNative --console=plain on the created project (after editing the test to make it fail) and got:

> Task :clean
> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar

> Task :quarkusBuild
building quarkus runner

> Task :assemble

> Task :buildNative
building native image

> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :compileNativeTestJava
> Task :processNativeTestResources NO-SOURCE
> Task :nativeTestClasses
> Task :quarkusTestConfig

> Task :testNative

org.acme.quickstart.NativeGreetingResourceIT > testHelloEndpoint() FAILED
    java.lang.AssertionError

1 test completed, 1 failed

> Task :testNative FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':testNative'.
> There were failing tests. See the report at: file:///home/gandrian/Desktop/foo/build/reports/tests/testNative/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 2m 7s
10 actionable tasks: 10 executed

If I revert the change to the test I get:

> Task :clean
> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar

> Task :quarkusBuild
building quarkus runner

> Task :assemble

> Task :buildNative
building native image

> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :compileNativeTestJava
> Task :processNativeTestResources NO-SOURCE
> Task :nativeTestClasses
> Task :quarkusTestConfig
> Task :testNative

BUILD SUCCESSFUL in 1m 16s
10 actionable tasks: 10 executed

So I am not sure what else to do about this.

@gastaldi
Copy link
Contributor Author

Hm, maybe I got confused because the test was not being shown in the console. I'll close the issue for now. Thanks for checking and sorry about the confusion

@gastaldi gastaldi added triage/invalid This doesn't seem right and removed kind/bug Something isn't working good first issue Good for newcomers labels Oct 26, 2019
@geoand
Copy link
Contributor

geoand commented Oct 26, 2019

Not a problem at all! The more scrutiny on this better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants