-
Notifications
You must be signed in to change notification settings - Fork 438
Expand file tree
/
Copy pathservice_test.go
More file actions
58 lines (42 loc) · 1.46 KB
/
service_test.go
File metadata and controls
58 lines (42 loc) · 1.46 KB
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
52
53
54
55
56
57
58
package test
import (
"path/filepath"
"strings"
"testing"
"github.com/gruntwork-io/terratest/modules/helm"
"github.com/gruntwork-io/terratest/modules/k8s"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
)
func TestTemplateServerServiceDefault(t *testing.T) {
// t.Parallel()
helmChartPath, err := filepath.Abs("../")
releaseName := "temporal"
require.NoError(t, err)
namespaceName := "temporal-" + strings.ToLower(random.UniqueId())
var deployment appsv1.Deployment
options := &helm.Options{
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
BuildDependencies: true,
}
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/server-service.yaml"})
helm.UnmarshalK8SYaml(t, output, &deployment)
}
func TestTemplateServerServiceFrontendClusterIP(t *testing.T) {
// t.Parallel()
helmChartPath, err := filepath.Abs("../")
releaseName := "temporal"
require.NoError(t, err)
namespaceName := "temporal-" + strings.ToLower(random.UniqueId())
var deployment appsv1.Deployment
options := &helm.Options{
SetValues: map[string]string{
"frontend.service.clusterIP": "None",
},
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
BuildDependencies: true,
}
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/server-service.yaml"})
helm.UnmarshalK8SYaml(t, output, &deployment)
}