-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(compute): extend compute hyperdisk pool create #9595
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
Changes from 7 commits
371273a
15c24c0
d810b7e
cef06ab
fbb8fa6
81891b3
55c7835
47ecd63
8294ad9
928be83
fdbb0f2
df550e2
3efab67
9fd467d
6dbb870
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
minherz marked this conversation as resolved.
minherz marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,6 @@ | |
| import org.junit.FixMethodOrder; | ||
| import org.junit.jupiter.api.AfterAll; | ||
| import org.junit.jupiter.api.BeforeAll; | ||
| import org.junit.jupiter.api.Disabled; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.Timeout; | ||
| import org.junit.runner.RunWith; | ||
|
|
@@ -48,6 +47,7 @@ public class HyperdisksIT { | |
| private static String HYPERDISK_NAME; | ||
| private static String HYPERDISK_IN_POOL_NAME; | ||
| private static String STORAGE_POOL_NAME; | ||
| private static final String PERFORMANCE_PROVISIONING_TYPE = "advanced"; | ||
|
|
||
| // Check if the required environment variables are set. | ||
| public static void requireEnvVar(String envVarName) { | ||
|
|
@@ -73,9 +73,9 @@ public static void cleanup() | |
| throws IOException, InterruptedException, ExecutionException, TimeoutException { | ||
| // Delete all disks created for testing. | ||
| DeleteDisk.deleteDisk(PROJECT_ID, ZONE, HYPERDISK_NAME); | ||
| //DeleteDisk.deleteDisk(PROJECT_ID, ZONE, HYPERDISK_IN_POOL_NAME); | ||
| DeleteDisk.deleteDisk(PROJECT_ID, ZONE, HYPERDISK_IN_POOL_NAME); | ||
|
minherz marked this conversation as resolved.
|
||
|
|
||
| //Util.deleteStoragePool(PROJECT_ID, ZONE, STORAGE_POOL_NAME); | ||
| Util.deleteStoragePool(PROJECT_ID, ZONE, STORAGE_POOL_NAME); | ||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -96,15 +96,15 @@ public void stage1_CreateHyperdiskTest() | |
| Assert.assertTrue(hyperdisk.getZone().contains(ZONE)); | ||
| } | ||
|
|
||
| @Disabled | ||
| @Test | ||
| public void stage1_CreateHyperdiskStoragePoolTest() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the name of the method follows snake notation and not pascal notation?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| throws IOException, ExecutionException, InterruptedException, TimeoutException { | ||
| String poolType = String.format("projects/%s/zones/%s/storagePoolTypes/hyperdisk-balanced", | ||
|
minherz marked this conversation as resolved.
|
||
| PROJECT_ID, ZONE); | ||
| StoragePool storagePool = CreateHyperdiskStoragePool | ||
| .createHyperdiskStoragePool(PROJECT_ID, ZONE, STORAGE_POOL_NAME, poolType, | ||
| "advanced", 10240, 10000, 10240); | ||
| "advanced", 10240, 10000, 10240, | ||
|
minherz marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the capacity to be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not understand what you mean by "creating a new task"? Do you propose to address code review comments made in this PR by submitting a separate PR? Regarding my question about the value
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| PERFORMANCE_PROVISIONING_TYPE); | ||
|
|
||
| Assert.assertNotNull(storagePool); | ||
| Assert.assertEquals(STORAGE_POOL_NAME, storagePool.getName()); | ||
|
|
@@ -113,10 +113,11 @@ public void stage1_CreateHyperdiskStoragePoolTest() | |
| Assert.assertEquals(10240, storagePool.getPoolProvisionedCapacityGb()); | ||
| Assert.assertTrue(storagePool.getStoragePoolType().contains("hyperdisk-balanced")); | ||
| Assert.assertTrue(storagePool.getCapacityProvisioningType().equalsIgnoreCase("advanced")); | ||
| Assert.assertTrue(storagePool.getPerformanceProvisioningType() | ||
| .equalsIgnoreCase(PERFORMANCE_PROVISIONING_TYPE)); | ||
| Assert.assertTrue(storagePool.getZone().contains(ZONE)); | ||
| } | ||
|
|
||
| @Disabled | ||
| @Test | ||
| public void stage2_CreateHyperdiskStoragePoolTest() | ||
| throws IOException, ExecutionException, InterruptedException, TimeoutException { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is being testing in this method that was not tested in the previous method? Why changing the arguments to the call to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've fixed naming for these tests. As I understand from code and tests
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. according to your explanations the second test does not validate the code sample. the code sample shows how to create a storage pool. the test(s) should validate the code. please, modify the test class to do one of the following, either to remove the second test because it does not add to the validation to code sample or perform all validations / asserts in the first test method.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have two classes - CreateDiskInStoragePool and CreateHyperdiskStoragePool. To test this code Svyatoslav created two test methods - testCreateDiskInStoragePool and testCreateHyperdiskStoragePool. As far as I can see, these tests are working properly |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.