Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privateca/snippets test(s) are failing #8966 #9320

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions privateca/snippets/src/test/java/privateca/SnippetsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,13 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
@Ignore("TODO: Fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/8966")
public class SnippetsIT {

private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private static String LOCATION;
private static String CA_poolId;
Expand Down Expand Up @@ -112,14 +109,15 @@ public static void setUp()
KEY_SIZE = 2048; // Default key size

// Delete stale resources
Util.cleanUpCaPool(PROJECT_ID, LOCATION);
TimeUnit.SECONDS.sleep(30);
// Util.cleanUpCaPool(PROJECT_ID, LOCATION);
// TimeUnit.SECONDS.sleep(30);
Comment on lines +112 to +113
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly uncomment this. I believe this deletes any stale CA pools leftover from previous tests.


// <--- START CA POOL --->
// Create CA Pool.
CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId);
CreateCaPool.createCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE);
sleep(5);

// Set the issuance policy for the created CA Pool.
UpdateCaPoolIssuancePolicy.updateCaPoolIssuancePolicy(PROJECT_ID, LOCATION, CA_poolId);
// <--- END CA POOL --->
Expand Down Expand Up @@ -313,7 +311,7 @@ public void testListCAPools() throws IOException {

@Test
public void testDeleteCAPool()
throws InterruptedException, ExecutionException, IOException, TimeoutException {
throws InterruptedException, ExecutionException, IOException {
DeleteCaPool.deleteCaPool(PROJECT_ID, LOCATION, CA_poolId_DELETE);
assertThat(stdOut.toString()).contains("Deleted CA Pool: " + CA_poolId_DELETE);
}
Expand Down Expand Up @@ -344,7 +342,7 @@ public void testUpdateCertificateAuthority()
}

@Test
public void testMonitorCertificateAuthority() throws IOException, InterruptedException {
public void testMonitorCertificateAuthority() throws IOException {
String policyName = MonitorCertificateAuthority.createCaMonitoringPolicy(PROJECT_ID);
assertThat(policyName).contains("projects/" + PROJECT_ID + "/alertPolicies/");

Expand Down
Loading