|
@@ -11,7 +11,7 @@ import (
|
|
|
|
|
|
|
|
func TestResolveJustificationUsesProvidedValue(t *testing.T) {
|
|
func TestResolveJustificationUsesProvidedValue(t *testing.T) {
|
|
|
cfg := config.DefaultConfig()
|
|
cfg := config.DefaultConfig()
|
|
|
- action := &config.Action{Title: "Send email", Justification: " ", Shell: "echo hi"}
|
|
|
|
|
|
|
+ action := &config.Action{Title: "Send email", Justification: config.JustificationRequiredNoTemplate, Shell: "echo hi"}
|
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
|
ex := DefaultExecutor(cfg)
|
|
ex := DefaultExecutor(cfg)
|
|
|
ex.RebuildActionMap()
|
|
ex.RebuildActionMap()
|
|
@@ -29,7 +29,7 @@ func TestResolveJustificationUsesProvidedValue(t *testing.T) {
|
|
|
|
|
|
|
|
func TestResolveJustificationCronDefault(t *testing.T) {
|
|
func TestResolveJustificationCronDefault(t *testing.T) {
|
|
|
cfg := config.DefaultConfig()
|
|
cfg := config.DefaultConfig()
|
|
|
- action := &config.Action{Title: "Nightly backup", Justification: " ", Shell: "echo hi"}
|
|
|
|
|
|
|
+ action := &config.Action{Title: "Nightly backup", Justification: config.JustificationRequiredNoTemplate, Shell: "echo hi"}
|
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
|
ex := DefaultExecutor(cfg)
|
|
ex := DefaultExecutor(cfg)
|
|
|
ex.RebuildActionMap()
|
|
ex.RebuildActionMap()
|
|
@@ -45,7 +45,7 @@ func TestResolveJustificationCronDefault(t *testing.T) {
|
|
|
|
|
|
|
|
func TestResolveJustificationStartupDefault(t *testing.T) {
|
|
func TestResolveJustificationStartupDefault(t *testing.T) {
|
|
|
cfg := config.DefaultConfig()
|
|
cfg := config.DefaultConfig()
|
|
|
- action := &config.Action{Title: "Init", Justification: " ", Shell: "echo hi"}
|
|
|
|
|
|
|
+ action := &config.Action{Title: "Init", Justification: config.JustificationRequiredNoTemplate, Shell: "echo hi"}
|
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
|
ex := DefaultExecutor(cfg)
|
|
ex := DefaultExecutor(cfg)
|
|
|
ex.RebuildActionMap()
|
|
ex.RebuildActionMap()
|
|
@@ -61,7 +61,7 @@ func TestResolveJustificationStartupDefault(t *testing.T) {
|
|
|
|
|
|
|
|
func TestResolveJustificationWebhookDefault(t *testing.T) {
|
|
func TestResolveJustificationWebhookDefault(t *testing.T) {
|
|
|
cfg := config.DefaultConfig()
|
|
cfg := config.DefaultConfig()
|
|
|
- action := &config.Action{Title: "Deploy", Justification: " ", Exec: []string{"echo", "deploy"}}
|
|
|
|
|
|
|
+ action := &config.Action{Title: "Deploy", Justification: config.JustificationRequiredNoTemplate, Exec: []string{"echo", "deploy"}}
|
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
cfg.Actions = append(cfg.Actions, action)
|
|
|
ex := DefaultExecutor(cfg)
|
|
ex := DefaultExecutor(cfg)
|
|
|
ex.RebuildActionMap()
|
|
ex.RebuildActionMap()
|
|
@@ -95,7 +95,7 @@ func TestJustificationNotPassedToShellArgs(t *testing.T) {
|
|
|
cfg := config.DefaultConfig()
|
|
cfg := config.DefaultConfig()
|
|
|
action := &config.Action{
|
|
action := &config.Action{
|
|
|
Title: "Echo",
|
|
Title: "Echo",
|
|
|
- Justification: " ",
|
|
|
|
|
|
|
+ Justification: config.JustificationRequiredNoTemplate,
|
|
|
Shell: "echo {{ message }}",
|
|
Shell: "echo {{ message }}",
|
|
|
Arguments: []config.ActionArgument{
|
|
Arguments: []config.ActionArgument{
|
|
|
{Name: "message", Type: "ascii_sentence"},
|
|
{Name: "message", Type: "ascii_sentence"},
|