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

Quarkus Gradle app plugin crashes when an app contains tests and no source #26013

Open
jskillin-idt opened this issue Jun 8, 2022 · 5 comments
Labels
area/gradle Gradle kind/bug Something isn't working

Comments

@jskillin-idt
Copy link
Contributor

Describe the bug

The Quarkus app I'm writing is made up entirely of extensions, and requires no source of its own. There are tests to make sure that everything wired up correctly. This means that the application project looks like this:

$ find -type f
./build.gradle
./src/test/java/org/acme/ExampleTest.java

It appears that the Quarkus Gradle app plugin expects a build/classes/java/main to exist. When running a build, I get this:

$ gradle build
Configuration on demand is an incubating feature.

> Task :app:test FAILED

ExampleTest > test() FAILED
    java.lang.RuntimeException at QuarkusTestExtension.java:632
        Caused by: java.lang.IllegalArgumentException at PathTree.java:28
            Caused by: java.nio.file.NoSuchFileException at UnixException.java:92

1 test completed, 1 failed

FAILURE: Build failed with an exception.

Expected behavior

The Quarkus Gradle app should recognize that the directory doesn't exist because there's no source and simply accept that there will be an empty list of classes.

Actual behavior

The Quarkus Gradle app crashes with a file access exception. Checking the contents of the stack, the relevant stack frame says:

Caused by: java.nio.file.NoSuchFileException: /home/jskillin/Projects/github/jskillin-idt/quarkusio-quarkus-issues-emptysrc/app/build/classes/java/main

The workaround that I've used is to drop an empty public class EmptyClass {} in src/main/java to bypass this.

How to Reproduce?

Steps to reproduce:

  1. Create deployment and runtime extension projects.
  2. Create an app project which depends on the runtime project.
  3. Add a QuarkusTest with a "test" function to the src/main/test of the app project. The test function can be empty and test nothing; the key is simply that an eligible test is detected by JUnit so the testing suite starts.
  4. Run "gradle build" in the app project or root project.

Output of uname -a or ver

Linux jacob-ubuntu-dev 5.15.0-35-generic #36-Ubuntu SMP Sat May 21 02:24:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.15" 2022-04-19 OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1) OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.9.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.4.2

Additional information

Reproduction git repo will be in the comments once I get the issue number.

@jskillin-idt jskillin-idt added the kind/bug Something isn't working label Jun 8, 2022
@quarkus-bot quarkus-bot bot added the area/gradle Gradle label Jun 8, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 8, 2022

/cc @glefloch, @quarkusio/devtools

@jskillin-idt
Copy link
Contributor Author

@jskillin-idt
Copy link
Contributor Author

jskillin-idt commented Jun 8, 2022

I apologize. The reproduction was built on Quarkus 2.7.5 but I do know it fails in the same way on 2.9.2. Edit: repo was updated to 2.9.2

@glefloch
Copy link
Member

glefloch commented Jun 9, 2022

Thanks for reporting this. We have the same problem with Quinoa. I'm looking into it

@glefloch
Copy link
Member

I have a weird error regarding the plateform configuration when I use my local branch. Do you face it too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants