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
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ final class PushGoldStatusToGithub extends ApiRequestHandler {
checkRuns = checkRuns ?? <Map<String, dynamic>>[];
log.debug('This PR has ${checkRuns.length} checks.');
for (var checkRun in checkRuns) {
log.debug('Check run: $checkRun');
final name = checkRun['name'].toLowerCase() as String;
if (slug == Config.flutterSlug) {
if (const <String>[
Expand All @@ -160,8 +159,13 @@ final class PushGoldStatusToGithub extends ApiRequestHandler {
runsGoldenFileTests = true;
}
}
if (checkRun['conclusion'] == null ||
checkRun['conclusion'].toUpperCase() != 'SUCCESS') {
const successfulConclusion = {'SUCCESS', 'NEUTRAL'};

if (checkRun['status']?.toUpperCase() != 'COMPLETED' ||
!successfulConclusion.contains(
checkRun['conclusion']?.toUpperCase(),
)) {
log.debug('Incomplete check run: $checkRun');
incompleteChecks.add(name);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,64 @@ void main() {
);
});

test(
'same commit, neutral checks complete, last status complete',
() async {
// Same commit
final pr = newPullRequest(123, 'abc', 'master');
prsFromGitHub = <PullRequest>[pr];

firestore.putDocument(
newGithubGoldStatus(
slug,
pr,
GithubGoldStatus.statusCompleted,
'abc',
config.flutterGoldSuccessValue!,
),
);

// Neutral checks complete
checkRuns = <dynamic>[
<String, String>{
'name': 'framework',
'status': 'completed',
'conclusion': 'neutral',
},
<String, String>{
'name': 'web engine',
'status': 'completed',
'conclusion': 'neutral',
},
];

final body = await tester.get(handler);
expect(body, same(Response.emptyOk));
expect(
firestore,
existsInStorage(fs.GithubGoldStatus.metadata, [
isGithubGoldStatus.hasUpdates(0),
]),
);
expect(log, hasNoWarningsOrHigher);

// Should not apply labels or make comments
verifyNever(
issuesService.addLabelsToIssue(slug, pr.number!, <String>[
kGoldenFileLabel,
]),
);

verifyNever(
issuesService.createComment(
slug,
pr.number!,
argThat(contains(config.flutterGoldCommentID(pr))),
),
);
},
);

test(
'same commit, checks complete, last status & gold status is running/awaiting triage, should not comment',
() async {
Expand Down Expand Up @@ -1160,7 +1218,7 @@ void main() {
checkRuns = <dynamic>[
<String, String>{
'name': 'framework',
'completed': 'in_progress',
'status': 'completed',
Comment thread
jtmcdole marked this conversation as resolved.
'conclusion': 'success',
},
];
Expand Down
Loading