Skip to content

Commit

Permalink
test: fixes cmek related tests (#1552)
Browse files Browse the repository at this point in the history
* samples: create test instance in cmek key location

Creates the test instance for encrypted database and backups in the same
region as the key location.

* test: moves test instances to east1

Moves test instance to east1 region to match the cmek key location.
  • Loading branch information
thiagotnunes committed Nov 12, 2021
1 parent 744dd64 commit 0bd5666
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion google-cloud-spanner/pom.xml
Expand Up @@ -70,7 +70,7 @@
<configuration>
<systemPropertyVariables>
<spanner.testenv.config.class>com.google.cloud.spanner.GceTestEnvConfig</spanner.testenv.config.class>
<spanner.testenv.instance>projects/gcloud-devel/instances/spanner-testing-west1</spanner.testenv.instance>
<spanner.testenv.instance>projects/gcloud-devel/instances/spanner-testing-east1</spanner.testenv.instance>
<spanner.gce.config.project_id>gcloud-devel</spanner.gce.config.project_id>
<spanner.testenv.kms_key.name>projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key</spanner.testenv.kms_key.name>
</systemPropertyVariables>
Expand Down
2 changes: 1 addition & 1 deletion samples/install-without-bom/pom.xml
Expand Up @@ -142,7 +142,7 @@
<version>3.0.0-M5</version>
<configuration>
<systemPropertyVariables>
<spanner.test.instance>spanner-testing-west1</spanner.test.instance>
<spanner.test.instance>spanner-testing-east1</spanner.test.instance>
<spanner.test.instance.mr>spanner-mr-testing</spanner.test.instance.mr>
<spanner.test.instance.config>nam6</spanner.test.instance.config>
<spanner.test.key.location>us-east1</spanner.test.key.location>
Expand Down
2 changes: 1 addition & 1 deletion samples/snapshot/pom.xml
Expand Up @@ -141,7 +141,7 @@
<version>3.0.0-M5</version>
<configuration>
<systemPropertyVariables>
<spanner.test.instance>spanner-testing-west1</spanner.test.instance>
<spanner.test.instance>spanner-testing-east1</spanner.test.instance>
<spanner.test.instance.mr>spanner-mr-testing</spanner.test.instance.mr>
<spanner.test.instance.config>nam6</spanner.test.instance.config>
<spanner.test.key.location>us-east1</spanner.test.key.location>
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/pom.xml
Expand Up @@ -146,7 +146,7 @@
<version>3.0.0-M5</version>
<configuration>
<systemPropertyVariables>
<spanner.test.instance>spanner-testing-west1</spanner.test.instance>
<spanner.test.instance>spanner-testing-east1</spanner.test.instance>
<spanner.test.instance.mr>spanner-mr-testing</spanner.test.instance.mr>
<spanner.test.instance.config>nam6</spanner.test.instance.config>
<spanner.test.key.location>us-east1</spanner.test.key.location>
Expand Down
Expand Up @@ -418,7 +418,7 @@ public void testEncryptedDatabaseAndBackupSamples() throws Exception {
instanceAdminClient
.createInstance(InstanceInfo.newBuilder(InstanceId.of(projectId, instanceId))
.setDisplayName("Encrypted test instance")
.setInstanceConfigId(InstanceConfigId.of(projectId, "regional-us-central1"))
.setInstanceConfigId(InstanceConfigId.of(projectId, "regional-" + keyLocation))
.setNodeCount(1).build())
.get();
try {
Expand Down

0 comments on commit 0bd5666

Please sign in to comment.