Skip to content

Commit 372d2dc

Browse files
fix: set parameters on correct fields + revoked custom acceptance tests
1 parent 961a9ca commit 372d2dc

File tree

3 files changed

+2
-268
lines changed

3 files changed

+2
-268
lines changed

mmv1/products/iamworkforcepool/WorkforcePool.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,12 @@ examples:
5555
workforce_pool_id: 'example-pool'
5656
test_env_vars:
5757
org_id: 'ORG_ID'
58-
# generated iam_policy tests are bugged because IamImportQualifiersForTest()
59-
# does not support 'workforce_pool_id' (see big if/else/break branching)
60-
exclude_test: true
6158
- name: 'iam_workforce_pool_full'
6259
primary_resource_id: 'example'
6360
vars:
6461
workforce_pool_id: 'example-pool'
6562
test_env_vars:
6663
org_id: 'ORG_ID'
67-
exclude_test: true
6864
iam_policy:
6965
parent_resource_attribute: 'workforce_pool_id'
7066
method_name_separator: ':'
@@ -73,7 +69,6 @@ iam_policy:
7369
- 'locations/{{location}}/workforcePools/{{workforce_pool_id}}'
7470
- '{{workforce_pool_id}}'
7571
parameters:
76-
properties:
7772
- name: 'location'
7873
type: String
7974
description: The location for the resource.
@@ -91,6 +86,7 @@ properties:
9186
immutable: true
9287
validation:
9388
function: 'ValidateWorkforcePoolId'
89+
properties:
9490
- name: 'name'
9591
type: String
9692
description: |

mmv1/third_party/terraform/services/iamworkforcepool/iam_iam_workforce_pool_test.go

Lines changed: 0 additions & 217 deletions
This file was deleted.

mmv1/third_party/terraform/services/iamworkforcepool/resource_iam_workforce_pool_test.go.tmpl

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
package iamworkforcepool_test
22

33
import (
4-
"fmt"
5-
"strings"
4+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
65
"testing"
7-
8-
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
9-
"github.com/hashicorp/terraform-plugin-testing/terraform"
10-
116
"github.com/hashicorp/terraform-provider-google/google/acctest"
127
"github.com/hashicorp/terraform-provider-google/google/envvar"
13-
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
14-
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
158
)
169

1710
func TestAccIAMWorkforcePoolWorkforcePool_full(t *testing.T) {
@@ -80,44 +73,6 @@ func TestAccIAMWorkforcePoolWorkforcePool_minimal(t *testing.T) {
8073
})
8174
}
8275

83-
func testAccCheckIAMWorkforcePoolWorkforcePoolDestroyProducer(t *testing.T) func(s *terraform.State) error {
84-
return func(s *terraform.State) error {
85-
for name, rs := range s.RootModule().Resources {
86-
if rs.Type != "google_iam_workforce_pool" {
87-
continue
88-
}
89-
if strings.HasPrefix(name, "data.") {
90-
continue
91-
}
92-
93-
config := acctest.GoogleProviderConfig(t)
94-
95-
url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{"{{"}}IAMWorkforcePoolBasePath{{"}}"}}locations/{{"{{"}}location{{"}}"}}/workforcePools/{{"{{"}}workforce_pool_id{{"}}"}}")
96-
if err != nil {
97-
return err
98-
}
99-
100-
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
101-
Config: config,
102-
Method: "GET",
103-
RawURL: url,
104-
UserAgent: config.UserAgent,
105-
})
106-
if err != nil {
107-
return nil
108-
}
109-
110-
if v := res["state"]; v == "DELETED" {
111-
return nil
112-
}
113-
114-
return fmt.Errorf("IAMWorkforcePool still exists at %s", url)
115-
}
116-
117-
return nil
118-
}
119-
}
120-
12176
func testAccIAMWorkforcePoolWorkforcePool_full(context map[string]interface{}) string {
12277
return acctest.Nprintf(`
12378
resource "google_iam_workforce_pool" "my_pool" {

0 commit comments

Comments
 (0)