Skip to content

notif: Add more tests for messaging style notif and fix for fetchBitmap #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

rajveermalviya
Copy link
Member

@rajveermalviya rajveermalviya commented Jul 15, 2024

Add more tests for Android messaging style notif implementation, listed here: #718 (review)

@rajveermalviya rajveermalviya force-pushed the pr-tests-messaging-style branch 2 times, most recently from c7d47ce to b59b751 Compare July 15, 2024 21:43
@rajveermalviya rajveermalviya changed the title notif: messaging style tests notif test: Expand test coverage for messaging style notif Jul 15, 2024
@rajveermalviya rajveermalviya marked this pull request as ready for review July 15, 2024 21:56
@rajveermalviya rajveermalviya added the buddy review GSoC buddy review needed. label Jul 15, 2024
@rajveermalviya rajveermalviya requested a review from Khader-1 July 15, 2024 22:38
Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya! Aside from some nits this looks good.
Also, I'd suggest to change the title of the PR to mention the update in the production code as well.

@rajveermalviya rajveermalviya force-pushed the pr-tests-messaging-style branch 2 times, most recently from 66738ac to 09c6cab Compare July 16, 2024 09:19
@rajveermalviya rajveermalviya changed the title notif test: Expand test coverage for messaging style notif notif: Add more tests for messaging style notif and fix for fetchBitmap Jul 16, 2024
@rajveermalviya
Copy link
Member Author

Thanks for the review @Khader-1, new revision pushed.

@rajveermalviya rajveermalviya requested a review from Khader-1 July 16, 2024 09:22
Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya for the revision! Just a tiny nit that I didn't catch in the previous review.

@rajveermalviya rajveermalviya force-pushed the pr-tests-messaging-style branch from 09c6cab to dadbcba Compare July 16, 2024 10:17
@rajveermalviya rajveermalviya requested a review from Khader-1 July 16, 2024 10:28
Copy link
Collaborator

@Khader-1 Khader-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya! LGTM. Over to mentor review now.

@Khader-1 Khader-1 requested review from kenclary and sumanthvrao July 16, 2024 10:39
@Khader-1 Khader-1 added mentor review GSoC mentor review needed. and removed buddy review GSoC buddy review needed. labels Jul 16, 2024
Copy link
Collaborator

@kenclary kenclary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@rajveermalviya rajveermalviya added maintainer review PR ready for review by Zulip maintainers and removed mentor review GSoC mentor review needed. labels Jul 16, 2024
@chrisbobbe
Copy link
Collaborator

With this command:

git rebase --exec 'tools/check --diff @~'

(running tools/check --diff @~ on each commit) I noticed there are some test failures in the first commit:

notif: Ensure fetchBitmap succeeds only on HTTP 200 status

After you fix those (and any failures on other commits; I haven't checked), I'll give this a proper review. 🙂

@rajveermalviya rajveermalviya force-pushed the pr-tests-messaging-style branch 2 times, most recently from a59eb50 to 03444bb Compare July 28, 2024 20:24
@rajveermalviya
Copy link
Member Author

Thanks for the review @chrisbobbe, pushed a new revision, PTAL.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Small comments below, and I'll mark this for Greg's review.

T Function() callback, {
http.Client Function()? httpClientFactory,
}) {
return http.runWithClient(callback, httpClientFactory ?? () => fakeHttpClient);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reading the ?? () => fakeHttpClient, I think it could help if fakeHttpClient had a more specific name, like fakeHttpClientGivingSuccess or something.

@@ -288,6 +288,66 @@ void main() {
expectedTagComponent: expectedTagComponent);
})));

test('stream message: multiple messages, different topics', () => runWithHttpClient(() => awaitFakeAsync((async) async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notif test: Add more tests for messaging style notif

Add more tests for Android messaging style notif implementation,
listed here:
    #718 (review)

It looks like you meant to link to a specific comment in #718, but there isn't a link to the comment.

@chrisbobbe chrisbobbe added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Jul 29, 2024
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya for writing this, and @Khader-1 @chrisbobbe for the previous reviews!

These tests look great. I agree with Chris's small comments above, and have a few nits below. Then this will be all ready to merge.

@@ -79,6 +83,21 @@ void main() {
TestZulipBinding.ensureInitialized();
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;

makeFakeHttpClient({http.Response? response, Exception? exception}) => http_testing.MockClient((request) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: explicit return type for function declaration, so it doesn't look like a function call

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is indeed a lint rule for this, always_declare_return_types:
https://dart.dev/tools/linter-rules/always_declare_return_types

I'll see about turning that on, since it keeps coming up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see about turning that on, since it keeps coming up.

#851

Comment on lines 90 to 91
});
final fakeHttpClient = makeFakeHttpClient(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: blank line

Suggested change
});
final fakeHttpClient = makeFakeHttpClient(
});
final fakeHttpClient = makeFakeHttpClient(

@rajveermalviya
Copy link
Member Author

Thanks for the review @chrisbobbe, @gnprice. Pushed a new revision, PTAL.

@rajveermalviya rajveermalviya requested a review from gnprice July 30, 2024 06:52
@rajveermalviya rajveermalviya force-pushed the pr-tests-messaging-style branch from 3530d94 to 289cea8 Compare July 30, 2024 06:58
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! Looks great — merging.

expectedTitle: otherUser.fullName,
expectedTagComponent: expectedTagComponent);

otherUser.email = '[email protected]';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch — I missed this in my review of the previous revision 🙂

@gnprice gnprice force-pushed the pr-tests-messaging-style branch from 289cea8 to 915b166 Compare July 30, 2024 16:31
@gnprice gnprice merged commit 915b166 into zulip:main Jul 30, 2024
1 check passed
@rajveermalviya rajveermalviya deleted the pr-tests-messaging-style branch July 30, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants