Skip to content

Commit 49e753f

Browse files
diegomarquezplqiu96
authored andcommitted
fix: include gax testlib for native image testing (#11556)
* fix: include gax testlib for native image testing gax-java [contains native-image configurations](https://github.com/googleapis/sdk-platform-java/blob/main/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties) that are common to all libraries. This fixes the ongoing nightly failures with messages such as: ``` 1) If it is intended that objects of type 'jdk.proxy4.$Proxy68' are persisted in the image heap, add '--initialize-at-build-time=org.junit.Ignore,java.lang.annotation.Annotation' ``` and ``` 1) If it is intended that objects of type 'org.junit.runners.model.FrameworkField' are persisted in the image heap, add '--initialize-at-build-time=org.junit.runners.model.FrameworkField' ``` The gax testlib [includes these classes](https://github.com/googleapis/sdk-platform-java/blob/main/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties): ``` Args=--initialize-at-build-time=java.lang.annotation.Annotation,\ org.junit.experimental.categories.Category,\ org.junit.experimental.categories.CategoryValidator,\ org.junit.Ignore,\ org.junit.runner.RunWith,\ org.junit.runners.model.FrameworkField,\ org.junit.validator.AnnotationValidator,\ org.junit.vintage.engine.discovery.FilterableIgnoringRunnerDecorator,\ org.junit.vintage.engine.discovery.IgnoringRunnerDecorator ``` * fix: include gax testlib in specific poms * chore: run lint job on java 17 This matches the minimum supported java version by the spotify fmt plugin
1 parent 12c126d commit 49e753f

5 files changed

Lines changed: 30 additions & 0 deletions

File tree

java-dns/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
<artifactId>threetenbp</artifactId>
7676
</dependency>
7777

78+
<dependency>
79+
<groupId>com.google.api</groupId>
80+
<artifactId>gax</artifactId>
81+
<classifier>testlib</classifier>
82+
<scope>test</scope>
83+
</dependency>
7884
<dependency>
7985
<groupId>com.google.cloud</groupId>
8086
<artifactId>google-cloud-core</artifactId>

java-notification/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
</dependency>
6969

7070
<!-- Test dependencies -->
71+
<dependency>
72+
<groupId>com.google.api</groupId>
73+
<artifactId>gax</artifactId>
74+
<classifier>testlib</classifier>
75+
<scope>test</scope>
76+
</dependency>
7177
<dependency>
7278
<groupId>junit</groupId>
7379
<artifactId>junit</artifactId>

java-recommender/google-cloud-recommender/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
</dependency>
7979

8080
<!-- Test dependencies -->
81+
<dependency>
82+
<groupId>com.google.api</groupId>
83+
<artifactId>gax</artifactId>
84+
<classifier>testlib</classifier>
85+
<scope>test</scope>
86+
</dependency>
8187
<dependency>
8288
<groupId>junit</groupId>
8389
<artifactId>junit</artifactId>

java-samples/native-image-sample/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
<groupId>com.google.cloud</groupId>
3535
<artifactId>google-cloud-secretmanager</artifactId>
3636
</dependency>
37+
<dependency>
38+
<groupId>com.google.api</groupId>
39+
<artifactId>gax</artifactId>
40+
<classifier>testlib</classifier>
41+
<scope>test</scope>
42+
</dependency>
3743
</dependencies>
3844

3945
<build>

java-speech/google-cloud-speech/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
</dependency>
9999

100100
<!-- Test dependencies -->
101+
<dependency>
102+
<groupId>com.google.api</groupId>
103+
<artifactId>gax</artifactId>
104+
<classifier>testlib</classifier>
105+
<scope>test</scope>
106+
</dependency>
101107
<dependency>
102108
<groupId>junit</groupId>
103109
<artifactId>junit</artifactId>

0 commit comments

Comments
 (0)