-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelmTest.go
42 lines (34 loc) · 929 Bytes
/
HelmTest.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
package backingservices
import (
"github.com/gruntwork-io/terratest/modules/helm"
"github.com/stretchr/testify/require"
"path/filepath"
"testing"
)
type HelmTest struct {
T *testing.T
ChartPath string
HelmOptions *helm.Options
Templates []string
}
func NewHelmTest(t *testing.T, chartRelativePath string, options map[string]string) *HelmTest {
t.Parallel()
path, err := filepath.Abs(chartRelativePath)
require.NoError(t, err)
return &HelmTest{
T: t,
ChartPath: path,
HelmOptions: &helm.Options{SetValues: options},
}
}
func NewHelmTestFromTemplate(t *testing.T, chartRelativePath string, options map[string]string, templateFiles []string) *HelmTest {
t.Parallel()
path, err := filepath.Abs(chartRelativePath)
require.NoError(t, err)
return &HelmTest{
T: t,
ChartPath: path,
HelmOptions: &helm.Options{SetValues: options},
Templates: templateFiles,
}
}