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
2 changes: 1 addition & 1 deletion source/dlangbot/cron.d
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ auto detectPRWithPersistentCIFailures(PRTuple t)
case "auto-tester":
case "CyberShadow/DAutoTest":
case "continuous-integration/travis-ci/pr":
case "continuous-integration/travis-ci/jenkins":
case "continuous-integration/jenkins/pr-merge":
case "appveyor":
case "ci/circleci":
return true;
Expand Down
25 changes: 25 additions & 0 deletions test/cronjob.d
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,28 @@ unittest

testCronDaily(repositories);
}

// test that two or more failing CI trigger "needs work"
unittest
{
setAPIExpectations(
"/github/repos/dlang/phobos/issues?state=open&sort=updated&direction=asc", (ref Json j) {
// only test one pull request
j = Json([j[0]]);
},
"/github/repos/dlang/phobos/pulls/2526",
"/github/repos/dlang/phobos/status/a04acd6a2813fb344d3e47369cf7fd64523ece44", (ref Json j) {
j["statuses"][1]["state"] = "error";
j["statuses"][2]["state"] = "failure";
},
"/github/repos/dlang/phobos/issues/2526/comments", &dontTestStalled,
"/github/repos/dlang/phobos/pulls/2526/comments",
"/github/repos/dlang/phobos/issues/2526/labels",
(scope HTTPServerRequest req, scope HTTPServerResponse res){
assert(req.method == HTTPMethod.PUT);
assert(req.json[].map!(e => e.get!string).equal(["blocked", "needs work"]));
},
);

testCronDaily(repositories);
}