Loading assets/auto-deploy-app/test/templates/deployment_test.go +63 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,26 @@ func TestDeploymentTemplate(t *testing.T) { ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: nil, }, { CaseName: "exec liveness probe", Release: "production", Values: map[string]string{ "livenessProbe.command[0]": "echo", "livenessProbe.command[1]": "hello", "livenessProbe.probeType": "exec", }, ExpectedLivenessProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 15, TimeoutSeconds: 15, }, ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: nil, }, { CaseName: "custom readiness probe", Release: "production", Loading Loading @@ -656,6 +676,26 @@ func TestDeploymentTemplate(t *testing.T) { }, ExpectedStartupProbe: nil, }, { CaseName: "exec readiness probe", Release: "production", Values: map[string]string{ "readinessProbe.command[0]": "echo", "readinessProbe.command[1]": "hello", "readinessProbe.probeType": "exec", }, ExpectedLivenessProbe: defaultLivenessProbe(), ExpectedReadinessProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 5, TimeoutSeconds: 3, }, ExpectedStartupProbe: nil, }, { CaseName: "custom startup probe", Release: "production", Loading Loading @@ -687,6 +727,29 @@ func TestDeploymentTemplate(t *testing.T) { PeriodSeconds: 10, }, }, { CaseName: "exec startup probe", Release: "production", Values: map[string]string{ "startupProbe.enabled": "true", "startupProbe.command[0]": "echo", "startupProbe.command[1]": "hello", "startupProbe.probeType": "exec", }, ExpectedLivenessProbe: defaultLivenessProbe(), ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 5, TimeoutSeconds: 3, FailureThreshold: 30, PeriodSeconds: 10, }, }, } { t.Run(tc.CaseName, func(t *testing.T) { namespaceName := "minimal-ruby-app-" + strings.ToLower(random.UniqueId()) Loading Loading
assets/auto-deploy-app/test/templates/deployment_test.go +63 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,26 @@ func TestDeploymentTemplate(t *testing.T) { ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: nil, }, { CaseName: "exec liveness probe", Release: "production", Values: map[string]string{ "livenessProbe.command[0]": "echo", "livenessProbe.command[1]": "hello", "livenessProbe.probeType": "exec", }, ExpectedLivenessProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 15, TimeoutSeconds: 15, }, ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: nil, }, { CaseName: "custom readiness probe", Release: "production", Loading Loading @@ -656,6 +676,26 @@ func TestDeploymentTemplate(t *testing.T) { }, ExpectedStartupProbe: nil, }, { CaseName: "exec readiness probe", Release: "production", Values: map[string]string{ "readinessProbe.command[0]": "echo", "readinessProbe.command[1]": "hello", "readinessProbe.probeType": "exec", }, ExpectedLivenessProbe: defaultLivenessProbe(), ExpectedReadinessProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 5, TimeoutSeconds: 3, }, ExpectedStartupProbe: nil, }, { CaseName: "custom startup probe", Release: "production", Loading Loading @@ -687,6 +727,29 @@ func TestDeploymentTemplate(t *testing.T) { PeriodSeconds: 10, }, }, { CaseName: "exec startup probe", Release: "production", Values: map[string]string{ "startupProbe.enabled": "true", "startupProbe.command[0]": "echo", "startupProbe.command[1]": "hello", "startupProbe.probeType": "exec", }, ExpectedLivenessProbe: defaultLivenessProbe(), ExpectedReadinessProbe: defaultReadinessProbe(), ExpectedStartupProbe: &coreV1.Probe{ ProbeHandler: coreV1.ProbeHandler{ Exec: &coreV1.ExecAction{ Command: []string{"echo", "hello"}, }, }, InitialDelaySeconds: 5, TimeoutSeconds: 3, FailureThreshold: 30, PeriodSeconds: 10, }, }, } { t.Run(tc.CaseName, func(t *testing.T) { namespaceName := "minimal-ruby-app-" + strings.ToLower(random.UniqueId()) Loading