MCPcopy Create free account
hub / github.com/github/gh-aw / TestBuildLabeledDisableCondition

Function TestBuildLabeledDisableCondition

pkg/workflow/maintenance_workflow_test.go:873–899  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

871}
872
873func TestBuildLabeledDisableCondition(t *testing.T) {
874 condition := buildLabeledDisableCondition()
875 rendered := RenderCondition(condition)
876
877 // Should only include issues event (not pull_request — issues-only by design)
878 if !strings.Contains(rendered, "github.event_name == 'issues'") {
879 t.Errorf("Condition should include issues event, got: %s", rendered)
880 }
881 if strings.Contains(rendered, "github.event_name == 'pull_request'") {
882 t.Errorf("Condition must not include pull_request event (issues-only), got: %s", rendered)
883 }
884
885 // Should check the label name
886 if !strings.Contains(rendered, "github.event.label.name == 'agentic-workflows:disable'") {
887 t.Errorf("Condition should check for agentic-workflows:disable label, got: %s", rendered)
888 }
889
890 // Should exclude forks
891 if !strings.Contains(rendered, "github.event.repository.fork") {
892 t.Errorf("Condition should exclude forks, got: %s", rendered)
893 }
894
895 // Should not include workflow_dispatch or schedule-related conditions
896 if strings.Contains(rendered, "workflow_dispatch") || strings.Contains(rendered, "workflow_call") {
897 t.Errorf("Condition should not reference workflow_dispatch or workflow_call, got: %s", rendered)
898 }
899}
900
901func TestBuildLabeledApplySafeOutputsCondition(t *testing.T) {
902 condition := buildLabeledApplySafeOutputsCondition()

Callers

nothing calls this directly

Calls 3

RenderConditionFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected