TestStatusCommentDecoupling tests the decoupling of status-comment from ai-reaction
(t *testing.T)
| 799 | |
| 800 | // TestStatusCommentDecoupling tests the decoupling of status-comment from ai-reaction |
| 801 | func TestStatusCommentDecoupling(t *testing.T) { |
| 802 | tests := []struct { |
| 803 | name string |
| 804 | aiReaction string |
| 805 | statusComment *bool |
| 806 | expectActivationComment bool |
| 807 | expectConclusionUpdate bool |
| 808 | expectActivationReaction bool |
| 809 | safeOutputJobNames []string |
| 810 | }{ |
| 811 | { |
| 812 | name: "ai-reaction without status-comment", |
| 813 | aiReaction: "eyes", |
| 814 | statusComment: nil, |
| 815 | expectActivationComment: false, |
| 816 | expectConclusionUpdate: false, |
| 817 | expectActivationReaction: true, |
| 818 | safeOutputJobNames: []string{"missing_tool"}, |
| 819 | }, |
| 820 | { |
| 821 | name: "both ai-reaction and status-comment enabled", |
| 822 | aiReaction: "eyes", |
| 823 | statusComment: boolPtr(true), |
| 824 | expectActivationComment: true, |
| 825 | expectConclusionUpdate: true, |
| 826 | expectActivationReaction: true, |
| 827 | safeOutputJobNames: []string{"missing_tool"}, |
| 828 | }, |
| 829 | { |
| 830 | name: "ai-reaction with explicit status-comment: false", |
| 831 | aiReaction: "eyes", |
| 832 | statusComment: boolPtr(false), |
| 833 | expectActivationComment: false, |
| 834 | expectConclusionUpdate: false, |
| 835 | expectActivationReaction: true, |
| 836 | safeOutputJobNames: []string{"missing_tool"}, |
| 837 | }, |
| 838 | { |
| 839 | name: "neither ai-reaction nor status-comment", |
| 840 | aiReaction: "", |
| 841 | statusComment: nil, |
| 842 | expectActivationComment: false, |
| 843 | expectConclusionUpdate: false, |
| 844 | expectActivationReaction: false, |
| 845 | safeOutputJobNames: []string{"missing_tool"}, |
| 846 | }, |
| 847 | { |
| 848 | name: "status-comment without ai-reaction", |
| 849 | aiReaction: "", |
| 850 | statusComment: boolPtr(true), |
| 851 | expectActivationComment: true, |
| 852 | expectConclusionUpdate: true, |
| 853 | expectActivationReaction: false, |
| 854 | safeOutputJobNames: []string{"missing_tool"}, |
| 855 | }, |
| 856 | { |
| 857 | name: "status-comment with ai-reaction: none", |
| 858 | aiReaction: "none", |
nothing calls this directly
no test coverage detected