-
Notifications
You must be signed in to change notification settings - Fork 11
docs(sample): add native-image sample #621
docs(sample): add native-image sample #621
Conversation
Relocating the sample from native-image-support to this repository
|
Warning: This pull request is touching the following templated files:
|
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>libraries-bom</artifactId> | ||
| <version>24.2.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the version that works with native-image-support 0.10.0.
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>native-image-support</artifactId> | ||
| <version>0.10.0</version> | ||
| </dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No JUnit-related dependencies because this project doesn't use JUnit.
| */ | ||
| public static void main(String[] args) throws IOException { | ||
| String projectId = ServiceOptions.getDefaultProjectId(); | ||
| LocationName parent = LocationName.of(projectId, "us-east1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: Does this work for those who don't use us-east1?
|
Awesome, thank you Tomo! Could we also add an integration test for this sample? |
|
@mpeddada1 I didn’t find an integration test in the native-support repository. Would you share the URL of it? |
Ah I'm afraid we have to manually write tests for the samples. We have a few examples if you'd like to refer to them: googleapis/java-firestore#872, https://github.com/googleapis/java-datastore/pull/640/files |
|
Thank you. |
|
The Kokoro failed and it shows: Next step: investigate how java-firestore reconcile Java version in Kokoro Sample build. Why java-firestore doesn't complain Java version in "Kokoro - Test: Samples"?https://source.cloud.google.com/results/invocations/416fe06b-014c-4092-97b3-7cd4b6d40496/targets succeeded. It doesn't have the native-image test target. The java-firestore directory has a special handling in This means, java-firestore doesn't run This special handling doesn't exist in java-tasks repository's build.sh. Problem in Java version for "Kokoro - Test: Samples"SAMPLE_FORMAT.md says we should consider Java 11. However the Kokoro Sample test infrastructure doesn't work for Java 11 Maven configuration. That's the gap we need to fill. Options
ConsiderationJava-tasks repository is just one of the many (~100) auto-generated libraries. Among them, we have some samples in some (12) repositories. What's the best way to address the gap across other repositories? |
mpeddada1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks
| * FAILED_PRECONDITION: The queue cannot be created because a queue with this name existed | ||
| * too recently. | ||
| */ | ||
| private static final String GRAALVM_TEST_QUEUE_NAME = "graal-test-queue-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we replace "graalvm" with "native" or "native-image"?

Relocating the sample from native-image-support to this repository
mvn clean verify -DskipTests -P lintpasses.Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.