Bigtable: Adding Integration Test of BigtableInstanceAdminClient#6186
Bigtable: Adding Integration Test of BigtableInstanceAdminClient#6186igorbernstein2 merged 2 commits intogoogleapis:masterfrom
Conversation
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #6186 +/- ##
=========================================
Coverage 47.51% 47.51%
- Complexity 27460 27475 +15
=========================================
Files 2526 2526
Lines 274681 274681
Branches 31402 31397 -5
=========================================
Hits 130521 130521
Misses 134528 134528
Partials 9632 9632Continue to review full report at Codecov.
|
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
| .addCluster(newClusterId, "us-central1-a", 1, StorageType.SSD) | ||
| .setDisplayName("Fresh-Instance-Name") | ||
| .addLabel("state", "readytodelete") | ||
| .setType(Instance.Type.PRODUCTION)); |
There was a problem hiding this comment.
I would use a development instance. Also, prod instances require at least 3 nodes, while your cluster only has 1
There was a problem hiding this comment.
Also, you should move this out of the try
There was a problem hiding this comment.
My apologies for the number of nodes. I have switched to Development cluster:
client.createInstance(
CreateInstanceRequest.of(newInstanceId)
.addCluster(newClusterId, "us-central1-a", 0, StorageType.SSD)
.setDisplayName("Fresh-Instance-Name")
.addLabel("state", "readytodelete")
.setType(Instance.Type.DEVELOPMENT));Q: This was confusing to me, whenever I used 1 for the server nodes it threw an IllegalArgumentException stating server nodes cannot be provided.
com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Error in field 'clusters' : Serve nodes cannot be specified for development instances.This worked fine when the server node is 0(It creates an instance with a cluster combining of 0 nodes). Should we change this behavior or should we update the docs?
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
...table/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Outdated
Show resolved
Hide resolved
- Test case for AppProfile, IAMPolicy, Instance, Clusters. - BigtableInstanceAdminClient in AbstractTestEnv. - Added cleanups for stale appProfile/instance/cluster. - Setup a cleanUpInstance() in case of prod or direct_path env type.
5866706 to
46c64c0
Compare
This PR contains Integration tests for BigtableInstanceAdminClient.
createBigtableResourceproperty is set along with other TestEnvRule properties.