From 6ec27ccbf7b8247d8207de48dfaed07405fbaa35 Mon Sep 17 00:00:00 2001 From: Karl Weinmeister Date: Tue, 13 Dec 2022 08:07:17 -0600 Subject: [PATCH 1/4] test: add MultipleAttemptsRule to FirewallIT --- compute/cloud-client/src/test/java/compute/FirewallIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compute/cloud-client/src/test/java/compute/FirewallIT.java b/compute/cloud-client/src/test/java/compute/FirewallIT.java index 6a64961274d..9fdea701cfa 100644 --- a/compute/cloud-client/src/test/java/compute/FirewallIT.java +++ b/compute/cloud-client/src/test/java/compute/FirewallIT.java @@ -22,6 +22,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.NotFoundException; import com.google.cloud.compute.v1.FirewallsClient; +import com.google.cloud.testing.junit4.MultipleAttemptsRule; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -36,12 +37,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import org.junit.Rule; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) @Timeout(value = 10, unit = TimeUnit.MINUTES) public class FirewallIT { + @Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3); private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String FIREWALL_RULE_CREATE; From c3312f1bc794a93d1b87f500825559ba527095bc Mon Sep 17 00:00:00 2001 From: Karl Weinmeister Date: Tue, 13 Dec 2022 08:12:11 -0600 Subject: [PATCH 2/4] linting --- compute/cloud-client/src/test/java/compute/FirewallIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/cloud-client/src/test/java/compute/FirewallIT.java b/compute/cloud-client/src/test/java/compute/FirewallIT.java index 9fdea701cfa..fd48d185cf4 100644 --- a/compute/cloud-client/src/test/java/compute/FirewallIT.java +++ b/compute/cloud-client/src/test/java/compute/FirewallIT.java @@ -31,13 +31,13 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.junit.Assert; +import org.junit.Rule; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.junit.Rule; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; From 271f522f85a2b12197e1ecee9c9a30df1ece4b5e Mon Sep 17 00:00:00 2001 From: Karl Weinmeister Date: Tue, 13 Dec 2022 09:22:15 -0600 Subject: [PATCH 3/4] test: add retries to failing snippet IT --- compute/cloud-client/src/test/java/compute/SnippetsIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compute/cloud-client/src/test/java/compute/SnippetsIT.java b/compute/cloud-client/src/test/java/compute/SnippetsIT.java index eae11167098..aac497bb342 100644 --- a/compute/cloud-client/src/test/java/compute/SnippetsIT.java +++ b/compute/cloud-client/src/test/java/compute/SnippetsIT.java @@ -30,6 +30,7 @@ import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; +import com.google.cloud.testing.junit4.MultipleAttemptsRule; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -38,6 +39,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.junit.Assert; +import org.junit.Rule; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -50,6 +52,7 @@ @RunWith(JUnit4.class) @Timeout(value = 10, unit = TimeUnit.MINUTES) public class SnippetsIT { + @Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3); private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); private static String ZONE; From 544e6444acac5a592eef33727466318bb6fa34cd Mon Sep 17 00:00:00 2001 From: Karl Weinmeister Date: Thu, 15 Dec 2022 11:54:11 -0600 Subject: [PATCH 4/4] chore: add aiplatform env vars --- .kokoro/tests/run_tests.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.kokoro/tests/run_tests.sh b/.kokoro/tests/run_tests.sh index 9c19a857ff7..292b78fd66b 100755 --- a/.kokoro/tests/run_tests.sh +++ b/.kokoro/tests/run_tests.sh @@ -67,14 +67,15 @@ if [[ "$SCRIPT_DEBUG" != "true" ]]; then export FILESTORE_IP_ADDRESS=$(gcloud secrets versions access latest --secret fs-app) SECRET_FILES=("java-docs-samples-service-account.json" \ + "java-aiplatform-samples-secrets.txt" \ + "java-automl-samples-secrets.txt" \ "java-aws-samples-secrets.txt" \ - "java-dlp-samples-secrets.txt" \ "java-bigtable-samples-secrets.txt" \ - "java-automl-samples-secrets.txt" \ + "java-cloud-sql-samples-secrets.txt" \ + "java-cts-v4-samples-secrets.txt" \ + "java-dlp-samples-secrets.txt" \ "java-functions-samples-secrets.txt" \ "java-firestore-samples-secrets.txt" \ - "java-cts-v4-samples-secrets.txt" \ - "java-cloud-sql-samples-secrets.txt" \ "java-scc-samples-secrets.txt") # create secret dir