Skip to content

Commit fed7606

Browse files
authored
Merge branch 'GoogleCloudPlatform:main' into magic-module-fork
2 parents 964e7ec + d43ef20 commit fed7606

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

mmv1/third_party/terraform/.teamcity/USE_CONFIG_WITH_TEAMCITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The next step is provide some input values that the configuration needs to fully
5151
* Click on the `Context Parameters` tab at the top of the page
5252
* On this page you can add key:value pairs, which are used as input to the configuration in `.teamcity/settings.kts`
5353
* First, we need to enter credentials information in a special way that keeps the values secure. Here is the process for the credentials to the GA nightly test project:
54-
* Find the credentials JSON file for that project, ensure that the value has no newlines
54+
* Find the credentials JSON file for that project, ensure that the value has no newlines (Running `cat CREDENTIALS.json | tr -s '\n' ' '` will remove newline characters from your JSON key file)
5555
* Click the dropdown menu next to `Actions` in the top right and click `Generate token for a secure value...`
5656
* Paste the credentials JSON string into the `Secure value` field nd click `Generate Token`.
5757
* Copy the value shown below the field, which should look like `credentialsJSON:<uuid>`
@@ -145,4 +145,4 @@ In scenarios liek this, you will see an error shown at the bottom of the `Versio
145145
To avoid bugs reaching TeamCity, validate all changes to the TeamCity configuration files locally before merging a PR:
146146
* Generate the GA provider from Magic Modules
147147
* In the GA provider repo, run `cd .teamcity`
148-
* Validate the configuration using `make validate`
148+
* Validate the configuration using `make validate`

mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
{{- end }}
2020

2121
"github.com/hashicorp/terraform-provider-google/google/envvar"
22+
"github.com/hashicorp/terraform-provider-google/google/services/tags"
2223
tpgcompute "github.com/hashicorp/terraform-provider-google/google/services/compute"
2324
"github.com/hashicorp/terraform-provider-google/google/services/privateca"
2425
"github.com/hashicorp/terraform-provider-google/google/services/resourcemanager"
@@ -2087,7 +2088,7 @@ func BootstrapSharedTestTagKey(t *testing.T, testId string) string {
20872088
"description": "Bootstrapped tag key for Terraform Acceptance testing",
20882089
}
20892090

2090-
_, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
2091+
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
20912092
Config: config,
20922093
Method: "POST",
20932094
Project: config.Project,
@@ -2101,6 +2102,15 @@ func BootstrapSharedTestTagKey(t *testing.T, testId string) string {
21012102
}
21022103

21032104
log.Printf("[DEBUG] Waiting for shared tag key creation to finish")
2105+
2106+
err = tags.TagsOperationWaitTime(
2107+
config, res, "Creating TagKey", config.UserAgent,
2108+
20 * time.Minute)
2109+
2110+
if err != nil {
2111+
// The resource didn't actually create
2112+
t.Fatalf("Error waiting to create TagKey: %s", err)
2113+
}
21042114
}
21052115

21062116
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
@@ -2163,7 +2173,7 @@ func BootstrapSharedTestTagValue(t *testing.T, testId string, tagKey string) str
21632173
"description": "Bootstrapped tag value for Terraform Acceptance testing",
21642174
}
21652175

2166-
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
2176+
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
21672177
Config: config,
21682178
Method: "POST",
21692179
Project: config.Project,
@@ -2172,11 +2182,21 @@ func BootstrapSharedTestTagValue(t *testing.T, testId string, tagKey string) str
21722182
Body: tagKeyObj,
21732183
Timeout: 10 * time.Minute,
21742184
})
2185+
21752186
if err != nil {
21762187
t.Fatalf("Error bootstrapping shared tag value %q: %s", sharedTagValue, err)
21772188
}
21782189

21792190
log.Printf("[DEBUG] Waiting for shared tag value creation to finish")
2191+
2192+
err = tags.TagsOperationWaitTime(
2193+
config, res, "Creating TagValue", config.UserAgent,
2194+
20 * time.Minute)
2195+
2196+
if err != nil {
2197+
// The resource didn't actually create
2198+
t.Fatalf("Error waiting to create TagValue: %s", err)
2199+
}
21802200
}
21812201

21822202
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{

mmv1/third_party/terraform/services/dns/resource_dns_record_set_test.go.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func TestAccDNSRecordSet_routingPolicy(t *testing.T) {
320320
ImportStateVerify: true,
321321
},
322322
{
323-
Config: testAccDnsRecordSet_routingPolicyRegionalL7PrimaryBackup(networkName, proxySubnetName, httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName, zoneName, 300),
323+
Config: testAccDnsRecordSet_routingPolicyRegionalL7PrimaryBackup(networkName, proxySubnetName+"-reg-l7", httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName+"-reg-l7", zoneName, 300),
324324
},
325325
{
326326
ResourceName: "google_dns_record_set.foobar",
@@ -329,7 +329,7 @@ func TestAccDNSRecordSet_routingPolicy(t *testing.T) {
329329
ImportStateVerify: true,
330330
},
331331
{
332-
Config: testAccDnsRecordSet_routingPolicyRegionalL7PrimaryBackupMultipleNoLbType(networkName, proxySubnetName, httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName, zoneName, 300),
332+
Config: testAccDnsRecordSet_routingPolicyRegionalL7PrimaryBackupMultipleNoLbType(networkName, proxySubnetName+"-reg-l7-nolbtype", httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName+"-reg-l7-nolbtype", zoneName, 300),
333333
},
334334
{
335335
ResourceName: "google_dns_record_set.foobar",
@@ -338,7 +338,7 @@ func TestAccDNSRecordSet_routingPolicy(t *testing.T) {
338338
ImportStateVerify: true,
339339
},
340340
{
341-
Config: testAccDnsRecordSet_routingPolicyCrossRegionL7PrimaryBackup(networkName, backendSubnetName, proxySubnetName, httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName, zoneName, 300),
341+
Config: testAccDnsRecordSet_routingPolicyCrossRegionL7PrimaryBackup(networkName, backendSubnetName, proxySubnetName+"-cross-reg-l7", httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName+"-cross-reg-l7", zoneName, 300),
342342
},
343343
{
344344
ResourceName: "google_dns_record_set.foobar",
@@ -347,7 +347,7 @@ func TestAccDNSRecordSet_routingPolicy(t *testing.T) {
347347
ImportStateVerify: true,
348348
},
349349
{
350-
Config: testAccDnsRecordSet_routingPolicyRegionalL7XLBPrimaryBackup(networkName, proxySubnetName, httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName, zoneName, 300),
350+
Config: testAccDnsRecordSet_routingPolicyRegionalL7XLBPrimaryBackup(networkName, proxySubnetName+"-reg-l7x", httpHealthCheckName, backendName, urlMapName, httpProxyName, forwardingRuleName+"-reg-l7x", zoneName, 300),
351351
},
352352
},
353353
})

0 commit comments

Comments
 (0)