-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathprovider_test.go
50 lines (45 loc) · 1.2 KB
/
provider_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package provider_test
import (
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/stretchr/testify/require"
"github.com/coder/terraform-provider-coder/provider"
)
func TestProvider(t *testing.T) {
t.Parallel()
tfProvider := provider.New()
err := tfProvider.InternalValidate()
require.NoError(t, err)
}
// TestProviderEmpty ensures that the provider can be configured without
// any actual input data. This is important for adding new fields
// with backwards compatibility guarantees.
func TestProviderEmpty(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
Providers: map[string]*schema.Provider{
"coder": provider.New(),
},
IsUnitTest: true,
Steps: []resource.TestStep{{
Config: `
provider "coder" {}
data "coder_provisioner" "me" {}
data "coder_workspace" "me" {}
data "coder_external_auth" "git" {
id = "git"
}
data "coder_git_auth" "git" {
id = "git"
}
data "coder_parameter" "param" {
name = "hey"
}`,
Check: func(state *terraform.State) error {
return nil
},
}},
})
}