File tree 5 files changed +56
-3
lines changed 5 files changed +56
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ require (
12
12
github.com/hashicorp/hc-install v0.5.0
13
13
github.com/hashicorp/hcl/v2 v2.16.1
14
14
github.com/hashicorp/logutils v1.0.0
15
- github.com/hashicorp/terraform-exec v0.18.0
15
+ github.com/hashicorp/terraform-exec v0.18.1
16
16
github.com/hashicorp/terraform-json v0.15.0
17
17
github.com/hashicorp/terraform-plugin-go v0.14.3
18
18
github.com/hashicorp/terraform-plugin-log v0.8.0
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI
101
101
github.com/hashicorp/logutils v1.0.0 /go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64 =
102
102
github.com/hashicorp/terraform-exec v0.18.0 h1:BJa6/Fhxnb0zvsEGqUrFSybcnhAiBVSUgG7s09b6XlI =
103
103
github.com/hashicorp/terraform-exec v0.18.0 /go.mod h1:6PMRgg0Capig5Fn0zW9/+WM3vQsdwotwa8uxDVzLpHE =
104
+ github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4 =
105
+ github.com/hashicorp/terraform-exec v0.18.1 /go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980 =
104
106
github.com/hashicorp/terraform-json v0.15.0 h1:/gIyNtR6SFw6h5yzlbDbACyGvIhKtQi8mTsbkNd79lE =
105
107
github.com/hashicorp/terraform-json v0.15.0 /go.mod h1:+L1RNzjDU5leLFZkHTFTbJXaoqUC6TqXlFgDoOXrtvk =
106
108
github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0 =
Original file line number Diff line number Diff line change
1
+ package resource
2
+
3
+ import (
4
+ "regexp"
5
+ "testing"
6
+ )
7
+
8
+ func TestTest_TestStep_ExpectError_NewConfig (t * testing.T ) {
9
+ t .Parallel ()
10
+
11
+ Test (t , TestCase {
12
+ ExternalProviders : map [string ]ExternalProvider {
13
+ "random" : {
14
+ Source : "registry.terraform.io/hashicorp/random" ,
15
+ VersionConstraint : "3.4.3" ,
16
+ },
17
+ },
18
+ Steps : []TestStep {
19
+ {
20
+ Config : `resource "random_string" "one" {
21
+ length = 2
22
+ min_upper = 4
23
+ }` ,
24
+ ExpectError : regexp .MustCompile (`Error: Invalid Attribute Value` ),
25
+ },
26
+ },
27
+ })
28
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ package resource
6
6
import (
7
7
"context"
8
8
"fmt"
9
+ "regexp"
9
10
"testing"
10
11
11
12
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -197,3 +198,25 @@ func TestTest_TestStep_ImportStateVerifyIgnore(t *testing.T) {
197
198
},
198
199
})
199
200
}
201
+
202
+ func TestTest_TestStep_ExpectError_ImportState (t * testing.T ) {
203
+ t .Parallel ()
204
+
205
+ Test (t , TestCase {
206
+ ExternalProviders : map [string ]ExternalProvider {
207
+ "random" : {
208
+ Source : "registry.terraform.io/hashicorp/time" ,
209
+ VersionConstraint : "0.9.1" ,
210
+ },
211
+ },
212
+ Steps : []TestStep {
213
+ {
214
+ Config : `resource "time_static" "one" {}` ,
215
+ ImportStateId : "invalid time string" ,
216
+ ResourceName : "time_static.one" ,
217
+ ImportState : true ,
218
+ ExpectError : regexp .MustCompile (`Error: Import time static error` ),
219
+ },
220
+ },
221
+ })
222
+ }
Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ func TestRetry(t *testing.T) {
30
30
}
31
31
32
32
// make sure a slow StateRefreshFunc is allowed to complete after timeout
33
+ //
34
+ //nolint:paralleltest // This test tends to fail when run in parallel and w/ test explorer
33
35
func TestRetry_grace (t * testing.T ) {
34
- t .Parallel ()
35
-
36
36
f := func () * RetryError {
37
37
time .Sleep (1 * time .Second )
38
38
return nil
You can’t perform that action at this time.
0 commit comments