Skip to content

Commit

Permalink
add test skipping assignment
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Stettler <[email protected]>
  • Loading branch information
replay committed Aug 2, 2024
1 parent a7eeeb0 commit 44afd57
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/labeler/labeler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,32 @@ func TestAssigningLabel(t *testing.T) {
issueNumber: testIssueNumber,
labels: []string{"label1", "label2", "mimir-query"},
}},
}, {
name: "don't assign label due to lack of required labels",
cfg: Config{
RequireLabel: []string{"label1", "label2"},
Labels: map[string]Label{
"mimir-query": {
Matchers: []Matcher{
{
regex: regexp.MustCompile(`.*`),
Weight: 1,
},
},
},
},
},
issue: &github.Issue{
Number: &testIssueNumber,
Title: github.String("some title"),
Body: github.String("some body abc something something query more text."),
RepositoryURL: &testRepositoreURL,
Labels: []github.Label{
{Name: github.String("label3")},
{Name: github.String("label4")},
},
},
expectedLabelAssignerCalls: nil,
},
}

Expand Down

0 comments on commit 44afd57

Please sign in to comment.