Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions pkg/workflow/compiler_safe_outputs_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) {
checkContains []string
checkJSON bool
expectedKeys []string
absentKeys []string
}{
{
name: "create issue config",
Expand Down Expand Up @@ -912,6 +913,40 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) {
checkJSON: true,
expectedKeys: []string{"replace_label"},
},
{
name: "steer enabled config",
safeOutputs: &SafeOutputsConfig{
Steer: true,
CreateIssues: &CreateIssuesConfig{
BaseSafeOutputConfig: BaseSafeOutputConfig{
Max: strPtr("1"),
},
},
},
checkContains: []string{
"GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG",
},
checkJSON: true,
expectedKeys: []string{"create_issue"},
Comment thread
github-actions[bot] marked this conversation as resolved.
absentKeys: []string{"steer"},
},
{
name: "steer disabled config",
safeOutputs: &SafeOutputsConfig{
Steer: false,
CreateIssues: &CreateIssuesConfig{
BaseSafeOutputConfig: BaseSafeOutputConfig{
Max: strPtr("1"),
},
},
},
checkContains: []string{
"GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG",
},
checkJSON: true,
expectedKeys: []string{"create_issue"},
absentKeys: []string{"steer"},
},
{
name: "mentions config",
safeOutputs: &SafeOutputsConfig{
Expand Down Expand Up @@ -1202,6 +1237,9 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) {
for _, key := range tt.expectedKeys {
assert.Contains(t, config, key, "Expected config key: "+key)
}
for _, key := range tt.absentKeys {
assert.NotContains(t, config, key, "Unexpected config key: "+key)
}
}
}
}
Expand Down