-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexamples_go_test.go
38 lines (34 loc) · 990 Bytes
/
examples_go_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
//go:build go || all
// +build go all
package examples
import (
"path/filepath"
"testing"
"github.com/pulumi/providertest/pulumitest"
"github.com/pulumi/providertest/pulumitest/opttest"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optrefresh"
)
func TestGoExamples(t *testing.T) {
tests := map[string]struct {
directoryName string
additionalConfig map[string]string
}{
"TestSimpleCertManagerGo": {directoryName: "simple-cert-manager-go"},
}
for name, test := range tests {
t.Run(name, func(t *testing.T) {
p := pulumitest.NewPulumiTest(t, test.directoryName,
opttest.LocalProviderPath("pulumi-kubernetes-cert-manager", filepath.Join(getCwd(t), "..", "bin")),
)
if test.additionalConfig != nil {
for key, value := range test.additionalConfig {
p.SetConfig(t, key, value)
}
}
p.Up(t)
p.Preview(t, optpreview.ExpectNoChanges())
p.Refresh(t, optrefresh.ExpectNoChanges())
})
}
}