test: adding native image configuration required for tests#754
test: adding native image configuration required for tests#754suztomo wants to merge 3 commits intogoogleapis:mainfrom
Conversation
|
|
4c393c6 to
fc8c7bd
Compare
|
|
44b9f2f to
ffaa03b
Compare
|
From the stacktrace, the error is from FileInputStream (stream for a file in a file system): where RESOURCES is "src/test/resources/" and image is "wakeupcat.jpg" for example. It seems the problem is the wrong working directory. If it was referring a resource, the error message would have "wakeupcat.jpg", not "src/test/resources/wakeupcat.jpg". |
|
I think this is a limitation of using resource configs with Graal: https://github.com/mpeddada1/native-resources-config/blob/main/child-module/src/test/java/com/example/ResourceExampleTest.java. FileInputStream/FileSystems doesn't recognize the resources-config.json. What happens if we reference the resource using the ClassLoader? |
|
I recognize this is the problem of working directory #856 (comment). JVM execution and GraalVM native-image execution show different output for working directory. I think the integration test is intended to use file as input, rather than resources, for documentation purpose on how to use this library. |
Trying to fix "Kokoro - Test: Java GraalVM Native Image" build.
https://source.cloud.google.com/results/invocations/cc541c2e-5da6-48bf-acb1-dd0d90f340b3/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fjava-vision%2Fpresubmit%2Fgraalvm-native/log
The test execution requires some configuration for native image to load resource files.