Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions prow/tide/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func (sc *statusController) expectedStatus(log *logrus.Entry, queryMap *config.Q
}

func retestingStatus(retested []string) string {
sort.Strings(retested)
all := fmt.Sprintf(statusNotInPool, fmt.Sprintf(" Retesting: %s", strings.Join(retested, " ")))
if len(all) > maxStatusDescriptionLength {
s := ""
Expand Down
106 changes: 106 additions & 0 deletions prow/tide/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,112 @@ func TestExpectedStatus(t *testing.T) {
state: github.StatusPending,
desc: "Not mergeable. Retesting: bar",
},
{
name: "missing passing up-to-date contexts",
inPool: true,
baseref: "baseref",
requiredContexts: []string{"foo", "bar", "baz"},
prowJobs: []runtime.Object{
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "123"},
Spec: prowapi.ProwJobSpec{
Context: "foo",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.SuccessState,
},
},
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "1234"},
Spec: prowapi.ProwJobSpec{
Context: "bar",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.PendingState,
},
},
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "12345"},
Spec: prowapi.ProwJobSpec{
Context: "baz",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.PendingState,
},
},
},

state: github.StatusPending,
desc: "Not mergeable. Retesting: bar baz",
},
{
name: "missing passing up-to-date contexts with different ordering",
inPool: true,
baseref: "baseref",
requiredContexts: []string{"foo", "bar", "baz"},
prowJobs: []runtime.Object{
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "123"},
Spec: prowapi.ProwJobSpec{
Context: "foo",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.SuccessState,
},
},
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "1234"},
Spec: prowapi.ProwJobSpec{
Context: "baz",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.PendingState,
},
},
&prowapi.ProwJob{
ObjectMeta: metav1.ObjectMeta{Name: "12345"},
Spec: prowapi.ProwJobSpec{
Context: "bar",
Refs: &prowapi.Refs{
BaseSHA: "baseref",
Pulls: []prowapi.Pull{{SHA: "head"}},
},
Type: prowapi.PresubmitJob,
},
Status: prowapi.ProwJobStatus{
State: prowapi.PendingState,
},
},
},

state: github.StatusPending,
desc: "Not mergeable. Retesting: bar baz",
},
{
name: "long list of not up-to-date contexts results in shortened message",
inPool: true,
Expand Down