Skip to content

fix: sets ServiceAccountTests in IAM package to Ignore #10042

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions iam/snippets/src/test/java/QuickstartTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down Expand Up @@ -87,6 +88,7 @@ public void tearDown() throws IOException {
}
}

@Ignore("issue #10041")
@Test
public void testQuickstart() throws Exception {
String member = "serviceAccount:" + serviceAccountEmail;
Expand Down
14 changes: 14 additions & 0 deletions iam/snippets/src/test/java/ServiceAccountTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -77,6 +78,7 @@ public void tearDown() {
bout.reset();
}

@Ignore("issue #10041")
@Test
public void stage1_testServiceAccountCreate() throws IOException {
Comment on lines +81 to 83

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage1_testServiceAccountCreate() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

ServiceAccount serviceAccount = CreateServiceAccount
Expand All @@ -88,6 +90,7 @@ public void stage1_testServiceAccountCreate() throws IOException {

}

@Ignore("issue #10041")
@Test
public void stage1_testServiceAccountsList() throws IOException {
Comment on lines +93 to 95

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage1_testServiceAccountsList() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

IAMClient.ListServiceAccountsPagedResponse response =
Expand All @@ -96,6 +99,7 @@ public void stage1_testServiceAccountsList() throws IOException {
assertTrue(response.iterateAll().iterator().hasNext());
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountRename() throws IOException {
Comment on lines +102 to 104

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountRename() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

String renameTo = "your-new-display-name";
Expand All @@ -108,6 +112,7 @@ public void stage2_testServiceAccountRename() throws IOException {
assertThat(renameTo, containsString(serviceAccount.getDisplayName()));
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountGet() throws IOException {
Comment on lines +115 to 117

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountGet() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

ServiceAccount account = GetServiceAccount.getServiceAccount(PROJECT_ID, SERVICE_ACCOUNT);
Expand All @@ -116,6 +121,7 @@ public void stage2_testServiceAccountGet() throws IOException {
assertEquals(PROJECT_ID, account.getProjectId());
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyCreate() throws IOException {
Comment on lines +124 to 126

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyCreate() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

ServiceAccountKey key = CreateServiceAccountKey.createKey(PROJECT_ID, SERVICE_ACCOUNT);
Expand All @@ -126,6 +132,7 @@ public void stage2_testServiceAccountKeyCreate() throws IOException {
assertNotNull(SERVICE_ACCOUNT_KEY_ID);
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyGet() throws IOException {
Comment on lines +135 to 137

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyGet() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

ServiceAccountKey key = GetServiceAccountKey
Expand All @@ -136,6 +143,7 @@ public void stage2_testServiceAccountKeyGet() throws IOException {
assertTrue(key.getName().contains(SERVICE_ACCOUNT));
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeysList() throws IOException {
Comment on lines +146 to 148

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeysList() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

List<ServiceAccountKey> keys = ListServiceAccountKeys.listKeys(PROJECT_ID, SERVICE_ACCOUNT);
Expand All @@ -146,6 +154,7 @@ public void stage2_testServiceAccountKeysList() throws IOException {
.anyMatch(keyName -> keyName.contains(SERVICE_ACCOUNT_KEY_ID)));
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyDisable() throws IOException {
Comment on lines +157 to 159

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyDisable() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

DisableServiceAccountKey
Expand All @@ -157,6 +166,7 @@ public void stage2_testServiceAccountKeyDisable() throws IOException {
assertTrue(key.getDisabled());
}

@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyEnable() throws IOException {
Comment on lines +169 to 171

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage2_testServiceAccountKeyEnable() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

EnableServiceAccountKey
Expand All @@ -168,6 +178,7 @@ public void stage2_testServiceAccountKeyEnable() throws IOException {
assertFalse(key.getDisabled());
}

@Ignore("issue #10041")
@Test
public void stage3_testServiceAccountKeyDelete() throws IOException {
Comment on lines +181 to 183

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage3_testServiceAccountKeyDelete() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

DeleteServiceAccountKey.deleteKey(PROJECT_ID, SERVICE_ACCOUNT, SERVICE_ACCOUNT_KEY_ID);
Expand All @@ -180,6 +191,7 @@ public void stage3_testServiceAccountKeyDelete() throws IOException {
assertThat(got, !containsString(SERVICE_ACCOUNT_KEY_ID).matches(got));
}

@Ignore("issue #10041")
@Test
public void stage4_testDisableServiceAccount() throws IOException {
Comment on lines +194 to 196

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage4_testDisableServiceAccount() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

DisableServiceAccount.disableServiceAccount(PROJECT_ID, SERVICE_ACCOUNT);
Expand All @@ -191,6 +203,7 @@ public void stage4_testDisableServiceAccount() throws IOException {
assertTrue(SERVICE_ACCOUNT, serviceAccount.getDisabled());
}

@Ignore("issue #10041")
@Test
public void stage5_testEnableServiceAccount() throws IOException {
Comment on lines +206 to 208

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage5_testEnableServiceAccount() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

EnableServiceAccount.enableServiceAccount(PROJECT_ID, SERVICE_ACCOUNT);
Expand All @@ -202,6 +215,7 @@ public void stage5_testEnableServiceAccount() throws IOException {
assertFalse(SERVICE_ACCOUNT, serviceAccount.getDisabled());
}

@Ignore("issue #10041")
@Test
public void stage6_testServiceAccountDelete() throws IOException {
Comment on lines +218 to 220

Choose a reason for hiding this comment

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

medium

Consider adding a brief comment explaining why these tests are being ignored, in addition to the issue number. This provides more context for future developers who might encounter this code. For example, you could state that the tests are temporarily disabled due to flakiness or incorrect behavior and will be re-enabled after refactoring.

Suggested change
@Ignore("issue #10041")
@Test
public void stage6_testServiceAccountDelete() throws IOException {
@Ignore("issue #10041: Temporarily disabled due to flakiness. Re-enable after refactoring.")
@Test

DeleteServiceAccount.deleteServiceAccount(PROJECT_ID, SERVICE_ACCOUNT);
Expand Down