File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ package provider_test
3
3
import (
4
4
"testing"
5
5
6
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
8
+ "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
6
9
"github.com/stretchr/testify/require"
7
10
8
11
"github.com/coder/terraform-provider-coder/provider"
@@ -14,3 +17,34 @@ func TestProvider(t *testing.T) {
14
17
err := tfProvider .InternalValidate ()
15
18
require .NoError (t , err )
16
19
}
20
+
21
+ // TestProviderEmpty ensures that the provider can be configured without
22
+ // any actual input data. This is important for adding new fields
23
+ // with backwards compatibility guarantees.
24
+ func TestProviderEmpty (t * testing.T ) {
25
+ t .Parallel ()
26
+ resource .Test (t , resource.TestCase {
27
+ Providers : map [string ]* schema.Provider {
28
+ "coder" : provider .New (),
29
+ },
30
+ IsUnitTest : true ,
31
+ Steps : []resource.TestStep {{
32
+ Config : `
33
+ provider "coder" {}
34
+ data "coder_provisioner" "me" {}
35
+ data "coder_workspace" "me" {}
36
+ data "coder_external_auth" "git" {
37
+ id = "git"
38
+ }
39
+ data "coder_git_auth" "git" {
40
+ id = "git"
41
+ }
42
+ data "coder_parameter" "param" {
43
+ name = "hey"
44
+ }` ,
45
+ Check : func (state * terraform.State ) error {
46
+ return nil
47
+ },
48
+ }},
49
+ })
50
+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
)
13
13
14
14
func TestProvisioner (t * testing.T ) {
15
+ t .Parallel ()
15
16
resource .Test (t , resource.TestCase {
16
17
Providers : map [string ]* schema.Provider {
17
18
"coder" : provider .New (),
You can’t perform that action at this time.
0 commit comments