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
GraphQL schema fail to generate in test #21066
Comments
/cc @jmartisk, @phillip-kruger |
@jhautin I'll have a look a.s.a.p |
@phillip-kruger thanks |
Just adapt the code for Java 11. run it on graalvm for java 11 and got same issue. I attached the adapted code |
Ok, this is a weird one ! I do not think this has anything to do with GraphQL, but rather with the structure. Alexey: When you build -skipTest and then ran the app, and do the request manually, everything works. Doing that same query in a test fails (before the app even starts, and it seems like the scanning exclude the library. If you look at the project structure, some code is in a separate lib. Any tips ? |
I'll have a look. |
This is caused by the JacocoProcessor applying bytecode transformation. |
Method parameter names get lost which is causing this method parameter name being null issue. |
As a "workaround", commenting out the |
@stuartwdouglas fyi |
Calling |
@aloubyansky I see it working if you just add:
to the library part of the reproducer. As far as I can tell the method names were never there in the first place. |
Ok, turns out Jandex is being clever and pulling this out of the local variable table if it was not compiled with this info, the local var table must be going missing. |
I think this can be closed as it is a Jacoco issue. You can work around it using the config I specified above. |
Thanks @stuartwdouglas and @aloubyansky . Closing. |
Just in case, I asked about it on the JaCoCo mailing list https://groups.google.com/u/1/g/jacoco/c/ggU-DrjtrAM |
thanks for the workaround. |
Just FYI, this PR in JaCoCo jacoco/jacoco#1246 will make it work. |
Describe the bug
Currently, since quarkus 2.3.1 (including quarkus 2.4.0), when running
mvn test
, the tests can not run. This is due to graphql schema builder failing to build schema. It was working fine before ( quarkus 2.2.3 and above).I suspect it is when involving an external library with an including a jandex index.
Note that test in dev mode is working fine.
The schema can not be build because the name of an argument is null.
graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'null'
Expected behavior
The
mvn test
should be able to start the test and run fine.Actual behavior
when running mvn test, no test are run as the quarkus application failed to initialize.
the complete error message
How to Reproduce?
This archive contains 2 maven projects
to reproduce:
mvn clean install
mvn quarkus:dev
mvn test
reproducers.zip
Output of
uname -a
orver
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Output of
java -version
openjdk version "16.0.1" 2021-04-20 OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 16.0.1+9-jvmci-21.1-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 16.0.1+9-jvmci-21.1-b05, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.3/2.3.1/2.4.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven home: C:\Program Files\apache-maven-3.8.1\bin.. Java version: 16.0.1, vendor: GraalVM Community, runtime: C:\Program Files\Oracle\graalvm-ce-java16-21.1.0 Default locale: fr_FR, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: