Skip to content

Commit

Permalink
Make gallery dependency file test-exempt
Browse files Browse the repository at this point in the history
dev/devicelab/lib/versions/gallery.dart contains the flutter/gallery
repo SHA to be synced during the gallery transitions test. Semantically,
it's similar to the engine's DEPS file or a pubspec.yaml in that updates
to it are version bumps.

This marks this file test exempt in our GitHub web hook.

Issue: flutter/flutter#114025
  • Loading branch information
cbracken committed Nov 2, 2022
1 parent 048df58 commit 09d3844
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ class GithubWebhookSubscription extends SubscriptionHandler {
filename.contains('pubspec.yaml') ||
// Exempt categories.
filename.contains('.github/') ||
filename.endsWith('.md');
filename.endsWith('.md') ||
// Exempt paths.
filename.startsWith('dev/devicelab/lib/versions/gallery.dart');
}

/// Returns the set of labels applicable to a file in the framework repo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,42 @@ void main() {
));
});

test('Framework does not label PR with no tests label if file is test exempt', () async {
const int issueNumber = 123;

tester.message = generateGithubWebhookMessage(
action: 'opened',
number: issueNumber,
);
final RepositorySlug slug = RepositorySlug('flutter', 'flutter');

when(pullRequestsService.listFiles(slug, issueNumber)).thenAnswer(
(_) => Stream<PullRequestFile>.value(
PullRequestFile()..filename = 'dev/devicelab/lib/versions/gallery.dart',
),
);

when(issuesService.listCommentsByIssue(slug, issueNumber)).thenAnswer(
(_) => Stream<IssueComment>.value(
IssueComment()..body = 'some other comment',
),
);

await tester.post(webhook);

verifyNever(issuesService.addLabelsToIssue(
slug,
issueNumber,
<String>['framework'],
));

verifyNever(issuesService.createComment(
slug,
issueNumber,
argThat(contains(config.missingTestsPullRequestMessageValue)),
));
});

test('Framework labels PRs, comment if no tests including hit_test.dart file', () async {
const int issueNumber = 123;

Expand Down

0 comments on commit 09d3844

Please sign in to comment.