Commit c2cde787 authored by Thong Kuah's avatar Thong Kuah
Browse files

Merge branch 'fix-chart-tests' into 'master'

ci: fix template tests not running after split

See merge request gitlab-org/cluster-integration/auto-deploy-image!182
parents 1d26a11c 8dd60417
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ chart:test:
    - go version
    - helm repo add stable https://charts.helm.sh/stable
    - helm dependency build .
    - cd test && GO111MODULE=auto go test .
    - cd test && GO111MODULE=auto go test ./...

# auto-deploy-image doesn't need to release the chart to https://charts.gitlab.io/,
# as it bundles a chart by default.
+1 −1
Original line number Diff line number Diff line
@@ -49,5 +49,5 @@ To run the tests, run the following commands from the root of your copy of `auto
helm repo add stable https://charts.helm.sh/stable # required only once
helm dependency build .               # required any time the dependencies change
cd test
GO111MODULE=auto go test .            # required for every change to the tests or the template
GO111MODULE=auto go test ./...        # required for every change to the tests or the template
```
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ SecRule REQUEST_HEADERS:Content-Type \"text/plain\" \"log,deny,id:\'20010\',stat
		},
		{
			name:       "with custom secRules",
			valueFiles: []string{"./testdata/modsecurity-ingress.yaml"},
			valueFiles: []string{"../testdata/modsecurity-ingress.yaml"},
			meta:       metav1.ObjectMeta{Annotations: secRulesAnnotations},
		},
	}
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ func TestNetworkPolicy(t *testing.T) {
		},
		{
			name:        "with custom policy",
			valueFiles:  []string{"./testdata/custom-policy.yaml"},
			valueFiles:  []string{"../testdata/custom-policy.yaml"},
			meta:        metav1.ObjectMeta{Name: releaseName + "-auto-deploy", Labels: expectedLabels},
			podSelector: metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
			ingress: []netV1.NetworkPolicyIngressRule{
@@ -75,7 +75,7 @@ func TestNetworkPolicy(t *testing.T) {
		},
		{
			name:        "with full spec policy",
			valueFiles:  []string{"./testdata/full-spec-policy.yaml"},
			valueFiles:  []string{"../testdata/full-spec-policy.yaml"},
			meta:        metav1.ObjectMeta{Name: releaseName + "-auto-deploy", Labels: expectedLabels},
			podSelector: metav1.LabelSelector{MatchLabels: map[string]string{}},
			policyTypes: []netV1.PolicyType{"Ingress", "Egress"},
+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ import (
)

const (
	chartName     = "auto-deploy-app-2.3.0"
	helmChartPath = ".."
	chartName     = "auto-deploy-app-2.4.0"
	helmChartPath = "../.."
)

func renderTemplate(t *testing.T, values map[string]string, releaseName string, templates []string, expectedErrorRegexp *regexp.Regexp) (string, bool) {