-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexamples_py_test.go
51 lines (45 loc) · 1.3 KB
/
examples_py_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
51
//go:build python || all
// +build python all
package examples
import (
"path/filepath"
"testing"
"github.com/pulumi/providertest/pulumitest"
"github.com/pulumi/providertest/pulumitest/opttest"
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optrefresh"
)
func getPythonBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
basePython := base.With(integration.ProgramTestOptions{
Dependencies: []string{
filepath.Join("..", "sdk", "python", "bin"),
},
})
return basePython
}
func TestPyExamples(t *testing.T) {
tests := map[string]struct {
directoryName string
additionalConfig map[string]string
}{
"TestSimpleCertManagerPy": {directoryName: "simple-cert-manager-py"},
}
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.Install(t)
p.Up(t)
p.Preview(t, optpreview.ExpectNoChanges())
p.Refresh(t, optrefresh.ExpectNoChanges())
})
}
}