Skip to content

Commit

Permalink
Add darwin/Tests/ to packages test pattern (flutter#3486)
Browse files Browse the repository at this point in the history
By repo convention, plugins using the shared darwin source structure put unit tests in darwin/Tests/
  • Loading branch information
stuartmorgan authored Feb 12, 2024
1 parent a25d386 commit f163e34
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ class GithubWebhookSubscription extends SubscriptionHandler {
// Native iOS/macOS tests.
filename.contains('RunnerTests/') ||
filename.contains('RunnerUITests/') ||
filename.contains('darwin/Tests/') ||
// Native Android tests.
filename.contains('android/src/test/') ||
filename.contains('androidTest/') ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,33 @@ void foo() {
);
});

test('Packages does not comment if shared Darwin native tests', () async {
const int issueNumber = 123;

tester.message = generateGithubWebhookMessage(
action: 'opened',
number: issueNumber,
slug: Config.packagesSlug,
baseRef: Config.defaultBranch(Config.packagesSlug),
);
when(pullRequestsService.listFiles(Config.packagesSlug, issueNumber)).thenAnswer(
(_) => Stream<PullRequestFile>.fromIterable(<PullRequestFile>[
PullRequestFile()..filename = 'packages/foo/foo_foundation/darwin/Classes/SomeClass.m',
PullRequestFile()..filename = 'packages/foo/foo_foundation/darwin/Tests/SomeClassTest.m',
]),
);

await tester.post(webhook);

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

test('Packages does not comment if editing test files in go_router', () async {
const int issueNumber = 123;

Expand Down

0 comments on commit f163e34

Please sign in to comment.