Skip to content

Commit f149410

Browse files
authored
fix: java 17 tests (GoogleCloudPlatform#7119)
1 parent f4f34fb commit f149410

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.kokoro/tests/run_test_java.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ if ! [[ ",$JAVA_VERSION," =~ ",$POM_JAVA," ]]; then
3838
exit 0
3939
fi
4040

41+
if [[ $JAVA_VERSION == "17" ]] && [[ "$file" == *"run/hello-broken/"* ]] || [[ "$file" == *"run/filesystem/"* ]]; then
42+
echo -e "\n Skipping tests: Sample ($file) tests do not work with Java 17\n"
43+
exit 0
44+
fi
45+
4146
# Build and deploy Cloud Functions hello-world samples
4247
# (Some of these samples have E2E tests that use deployed functions.)
4348
if [[ "$file" == *"functions/helloworld/"* ]]; then

run/system-package/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ limitations under the License.
5555

5656
<build>
5757
<plugins>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-surefire-plugin</artifactId>
61+
<version>3.0.0-M5</version>
62+
<configuration>
63+
<!-- Needed only for Java 17 -->
64+
<forkCount>0</forkCount>
65+
<argLine>-Xmx1024m</argLine>
66+
<argLine>--add-opens java.base/java.util=ALL-UNNAMED</argLine>
67+
</configuration>
68+
</plugin>
5869
<!-- [START cloudrun_system_package_jib] -->
5970
<!-- [START run_system_package_jib] -->
6071
<plugin>

0 commit comments

Comments
 (0)