Skip to content

Commit eaab4a6

Browse files
rainkwanstephybun
andauthored
Initial work on Query command for List Resource (#531)
* Initial work on Query command for List Resource * Added helper/resource parts for query * Moved files * But what if we comment out print statements? * What if we are more specific and say `.tfquery.hcl` * Updating to version 1.14 for query_test.go * Update testing_new.go * Update helper/resource/query/query_test.go Co-authored-by: stephybun <[email protected]> * Update internal/plugintest/working_dir.go Co-authored-by: stephybun <[email protected]> * Update internal/teststep/file.go Co-authored-by: stephybun <[email protected]> --------- Co-authored-by: stephybun <[email protected]>
1 parent 8047bdc commit eaab4a6

File tree

21 files changed

+610
-34
lines changed

21 files changed

+610
-34
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ require (
1313
github.com/hashicorp/hc-install v0.9.2
1414
github.com/hashicorp/hcl/v2 v2.24.0
1515
github.com/hashicorp/logutils v1.0.0
16-
github.com/hashicorp/terraform-exec v0.23.0
16+
github.com/hashicorp/terraform-exec v0.23.1-0.20250717072919-061a850a52d2
1717
github.com/hashicorp/terraform-json v0.25.0
18-
github.com/hashicorp/terraform-plugin-go v0.28.0
18+
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1
1919
github.com/hashicorp/terraform-plugin-log v0.9.0
2020
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
2121
github.com/mitchellh/go-testing-interface v1.14.1
@@ -36,7 +36,7 @@ require (
3636
github.com/hashicorp/go-multierror v1.1.1 // indirect
3737
github.com/hashicorp/go-plugin v1.6.3 // indirect
3838
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
39-
github.com/hashicorp/terraform-registry-address v0.2.5 // indirect
39+
github.com/hashicorp/terraform-registry-address v0.3.0 // indirect
4040
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
4141
github.com/hashicorp/yamux v0.1.1 // indirect
4242
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -56,7 +56,7 @@ require (
5656
golang.org/x/text v0.27.0 // indirect
5757
golang.org/x/tools v0.34.0 // indirect
5858
google.golang.org/appengine v1.6.8 // indirect
59-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
60-
google.golang.org/grpc v1.72.1 // indirect
59+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
60+
google.golang.org/grpc v1.73.0 // indirect
6161
google.golang.org/protobuf v1.36.6 // indirect
6262
)

go.sum

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ github.com/hashicorp/hcl/v2 v2.24.0 h1:2QJdZ454DSsYGoaE6QheQZjtKZSUs9Nh2izTWiwQx
7676
github.com/hashicorp/hcl/v2 v2.24.0/go.mod h1:oGoO1FIQYfn/AgyOhlg9qLC6/nOJPX3qGbkZpYAcqfM=
7777
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
7878
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
79-
github.com/hashicorp/terraform-exec v0.23.0 h1:MUiBM1s0CNlRFsCLJuM5wXZrzA3MnPYEsiXmzATMW/I=
80-
github.com/hashicorp/terraform-exec v0.23.0/go.mod h1:mA+qnx1R8eePycfwKkCRk3Wy65mwInvlpAeOwmA7vlY=
79+
github.com/hashicorp/terraform-exec v0.23.1-0.20250717072919-061a850a52d2 h1:90fcAqw0Qmv4vY7zL4jEKgKarHmOnNN6SjTY68eLKGA=
80+
github.com/hashicorp/terraform-exec v0.23.1-0.20250717072919-061a850a52d2/go.mod h1:8D3RLLpzAZdhT9jvALYz1KHyGU4OvI73I1o0+01QJxA=
8181
github.com/hashicorp/terraform-json v0.25.0 h1:rmNqc/CIfcWawGiwXmRuiXJKEiJu1ntGoxseG1hLhoQ=
8282
github.com/hashicorp/terraform-json v0.25.0/go.mod h1:sMKS8fiRDX4rVlR6EJUMudg1WcanxCMoWwTLkgZP/vc=
83-
github.com/hashicorp/terraform-plugin-go v0.28.0 h1:zJmu2UDwhVN0J+J20RE5huiF3XXlTYVIleaevHZgKPA=
84-
github.com/hashicorp/terraform-plugin-go v0.28.0/go.mod h1:FDa2Bb3uumkTGSkTFpWSOwWJDwA7bf3vdP3ltLDTH6o=
83+
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1 h1:ZId6oWG8VTKhz207quE/Xh8a3HuoLtM/QkcSSypekIQ=
84+
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1/go.mod h1:hL//wLEfYo0YVt0TC/VLzia/ADQQto3HEm4/jX2gkdY=
8585
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
8686
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
8787
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM=
8888
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA=
89-
github.com/hashicorp/terraform-registry-address v0.2.5 h1:2GTftHqmUhVOeuu9CW3kwDkRe4pcBDq0uuK5VJngU1M=
90-
github.com/hashicorp/terraform-registry-address v0.2.5/go.mod h1:PpzXWINwB5kuVS5CA7m1+eO2f1jKb5ZDIxrOPfpnGkg=
89+
github.com/hashicorp/terraform-registry-address v0.3.0 h1:HMpK3nqaGFPS9VmgRXrJL/dzHNdheGVKk5k7VlFxzCo=
90+
github.com/hashicorp/terraform-registry-address v0.3.0/go.mod h1:jRGCMiLaY9zii3GLC7hqpSnwhfnCN5yzvY0hh4iCGbM=
9191
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
9292
github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc=
9393
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
@@ -152,16 +152,16 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6
152152
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
153153
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
154154
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
155-
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
156-
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
157-
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
158-
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
159-
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
160-
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
161-
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
162-
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
163-
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
164-
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
155+
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
156+
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
157+
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
158+
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
159+
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
160+
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
161+
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
162+
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
163+
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
164+
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
165165
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
166166
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
167167
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
@@ -214,10 +214,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
214214
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
215215
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
216216
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
217-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4=
218-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ=
219-
google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA=
220-
google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
217+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g=
218+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
219+
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
220+
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
221221
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
222222
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
223223
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package query_test
5+
6+
import (
7+
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
8+
"github.com/hashicorp/terraform-plugin-go/tftypes"
9+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider"
10+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/resource"
11+
"github.com/hashicorp/terraform-plugin-testing/internal/teststep"
12+
)
13+
14+
func examplecloudResource() testprovider.Resource {
15+
return testprovider.Resource{
16+
CreateResponse: &resource.CreateResponse{
17+
NewState: tftypes.NewValue(
18+
tftypes.Object{
19+
AttributeTypes: map[string]tftypes.Type{
20+
"id": tftypes.String,
21+
"location": tftypes.String,
22+
"name": tftypes.String,
23+
},
24+
},
25+
map[string]tftypes.Value{
26+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
27+
"location": tftypes.NewValue(tftypes.String, "westeurope"),
28+
"name": tftypes.NewValue(tftypes.String, "somevalue"),
29+
},
30+
),
31+
NewIdentity: teststep.Pointer(tftypes.NewValue(
32+
tftypes.Object{
33+
AttributeTypes: map[string]tftypes.Type{
34+
"id": tftypes.String,
35+
},
36+
},
37+
map[string]tftypes.Value{
38+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
39+
},
40+
)),
41+
},
42+
ReadResponse: &resource.ReadResponse{
43+
NewState: tftypes.NewValue(
44+
tftypes.Object{
45+
AttributeTypes: map[string]tftypes.Type{
46+
"id": tftypes.String,
47+
"location": tftypes.String,
48+
"name": tftypes.String,
49+
},
50+
},
51+
map[string]tftypes.Value{
52+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
53+
"location": tftypes.NewValue(tftypes.String, "westeurope"),
54+
"name": tftypes.NewValue(tftypes.String, "somevalue"),
55+
},
56+
),
57+
NewIdentity: teststep.Pointer(tftypes.NewValue(
58+
tftypes.Object{
59+
AttributeTypes: map[string]tftypes.Type{
60+
"id": tftypes.String,
61+
},
62+
},
63+
map[string]tftypes.Value{
64+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
65+
},
66+
)),
67+
},
68+
ImportStateResponse: &resource.ImportStateResponse{
69+
State: tftypes.NewValue(
70+
tftypes.Object{
71+
AttributeTypes: map[string]tftypes.Type{
72+
"id": tftypes.String,
73+
"location": tftypes.String,
74+
"name": tftypes.String,
75+
},
76+
},
77+
map[string]tftypes.Value{
78+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
79+
"location": tftypes.NewValue(tftypes.String, "westeurope"),
80+
"name": tftypes.NewValue(tftypes.String, "somevalue"),
81+
},
82+
),
83+
Identity: teststep.Pointer(tftypes.NewValue(
84+
tftypes.Object{
85+
AttributeTypes: map[string]tftypes.Type{
86+
"id": tftypes.String,
87+
},
88+
},
89+
map[string]tftypes.Value{
90+
"id": tftypes.NewValue(tftypes.String, "westeurope/somevalue"),
91+
},
92+
)),
93+
},
94+
SchemaResponse: &resource.SchemaResponse{
95+
Schema: &tfprotov6.Schema{
96+
Block: &tfprotov6.SchemaBlock{
97+
Attributes: []*tfprotov6.SchemaAttribute{
98+
ComputedStringAttribute("id"),
99+
RequiredStringAttribute("location"),
100+
RequiredStringAttribute("name"),
101+
},
102+
},
103+
},
104+
},
105+
IdentitySchemaResponse: &resource.IdentitySchemaResponse{
106+
Schema: &tfprotov6.ResourceIdentitySchema{
107+
Version: 1,
108+
IdentityAttributes: []*tfprotov6.ResourceIdentitySchemaAttribute{
109+
{
110+
Name: "id",
111+
Type: tftypes.String,
112+
RequiredForImport: true,
113+
},
114+
},
115+
},
116+
},
117+
}
118+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package query_test
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
10+
r "github.com/hashicorp/terraform-plugin-testing/helper/resource"
11+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider"
12+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/list"
13+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/providerserver"
14+
"github.com/hashicorp/terraform-plugin-testing/tfversion"
15+
)
16+
17+
func TestQuery(t *testing.T) {
18+
t.Parallel()
19+
20+
r.UnitTest(t, r.TestCase{
21+
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
22+
tfversion.SkipBelow(tfversion.Version1_14_0),
23+
},
24+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
25+
"examplecloud": providerserver.NewProviderServer(testprovider.Provider{
26+
ListResources: map[string]testprovider.ListResource{
27+
"examplecloud_containerette": {
28+
SchemaResponse: &list.SchemaResponse{
29+
Schema: &tfprotov6.Schema{
30+
Block: &tfprotov6.SchemaBlock{
31+
Attributes: []*tfprotov6.SchemaAttribute{
32+
ComputedStringAttribute("id"),
33+
},
34+
},
35+
},
36+
},
37+
ListResultsStream: &list.ListResultsStream{
38+
Results: func(push func(list.ListResult) bool) {
39+
},
40+
},
41+
},
42+
},
43+
Resources: map[string]testprovider.Resource{
44+
"examplecloud_containerette": examplecloudResource(),
45+
},
46+
}),
47+
},
48+
Steps: []r.TestStep{
49+
{
50+
Query: true,
51+
Config: `
52+
provider "examplecloud" {}
53+
list "examplecloud_containerette" "test" {
54+
provider = examplecloud
55+
56+
config {
57+
id = "bat"
58+
}
59+
}`,
60+
},
61+
},
62+
})
63+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package query_test
5+
6+
import (
7+
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
8+
"github.com/hashicorp/terraform-plugin-go/tftypes"
9+
)
10+
11+
func RequiredBoolAttribute(name string) *tfprotov6.SchemaAttribute {
12+
return &tfprotov6.SchemaAttribute{
13+
Name: name,
14+
Type: tftypes.Bool,
15+
Required: true,
16+
}
17+
}
18+
19+
func OptionalComputedListAttribute(name string, elementType tftypes.Type) *tfprotov6.SchemaAttribute {
20+
return &tfprotov6.SchemaAttribute{
21+
Name: name,
22+
Type: tftypes.List{ElementType: elementType},
23+
Optional: true,
24+
Computed: true,
25+
}
26+
}
27+
28+
func RequiredListAttribute(name string, elementType tftypes.Type) *tfprotov6.SchemaAttribute {
29+
return &tfprotov6.SchemaAttribute{
30+
Name: name,
31+
Type: tftypes.List{ElementType: elementType},
32+
Required: true,
33+
}
34+
}
35+
36+
func RequiredNumberAttribute(name string) *tfprotov6.SchemaAttribute {
37+
return &tfprotov6.SchemaAttribute{
38+
Name: name,
39+
Type: tftypes.Number,
40+
Required: true,
41+
}
42+
}
43+
44+
func ComputedStringAttribute(name string) *tfprotov6.SchemaAttribute {
45+
return &tfprotov6.SchemaAttribute{
46+
Name: name,
47+
Type: tftypes.String,
48+
Computed: true,
49+
}
50+
}
51+
52+
func OptionalStringAttribute(name string) *tfprotov6.SchemaAttribute {
53+
return &tfprotov6.SchemaAttribute{
54+
Name: name,
55+
Type: tftypes.String,
56+
Optional: true,
57+
}
58+
}
59+
60+
func RequiredStringAttribute(name string) *tfprotov6.SchemaAttribute {
61+
return &tfprotov6.SchemaAttribute{
62+
Name: name,
63+
Type: tftypes.String,
64+
Required: true,
65+
}
66+
}

helper/resource/testing.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,9 @@ type TestStep struct {
835835
// for performing import testing where the prior TestStep configuration
836836
// contained a provider outside the one under test.
837837
ExternalProviders map[string]ExternalProvider
838+
839+
// If true, the test step will run the query command
840+
Query bool
838841
}
839842

840843
// ConfigPlanChecks defines the different points in a Config TestStep when plan checks can be run.

0 commit comments

Comments
 (0)