Skip to content
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

Test device activation, subscription, receiving messages and deactivation #153

Closed
ably-sync-bot opened this issue Aug 18, 2021 · 3 comments
Assignees

Comments

@ably-sync-bot
Copy link

ably-sync-bot commented Aug 18, 2021

This is split from https://ably.atlassian.net/browse/SDK-712

We want to make sure there are unit tests that exercise the state machine, and the functionality of the Flutter bindings. This is a follow-on from the above ticket.

┆Issue is synchronized with this Jira Task by Unito

@ben-xD ben-xD changed the title Unit tests for device registration Test device activation and deactivation Aug 20, 2021
@ably-sync-bot ably-sync-bot changed the title Test device activation and deactivation Test device activation, subscription, receiving messages and deactivation Sep 14, 2021
@ikurek
Copy link
Contributor

ikurek commented Feb 18, 2022

I've started working on implementing these tests and I found out a few problems on the way:

  1. Integration tests ran on iOS devices won't function properly - virtual devices can't be used with APNS, so it's not possible to register them for push messages. Sadly, there's no solution for this, other than running these tests on physical deivces
  2. Integration tests ran on Android devices will run fine, but they require a Firebase configuration to run. This crates a requirement to create a separate Firebase instance used for integration testing.

@QuintinWillison I'd like to get your feedback on this - should I proceed with implementing these tests for Android only? In that case, I'd need a dedicated instance of Firebase.

@QuintinWillison
Copy link
Contributor

@ikurek That would be great, yes please.

@ikurek
Copy link
Contributor

ikurek commented Mar 1, 2022

@QuintinWillison I'm closing this as discussed yesterday. Here's a short review why:

  • Integration testing on iOS doesn't make sense, because virtual iOS devices aren't APNS-enabled, so they won't be able to register for push notifications
  • Integration testing on Android requires a Firebase instance to work. Setting up a specific test instance of Firebase isn't a problem, but there's no API in the Ably instance provisioning system that would allow us to configure integration testing instances of Ably to work with FCM pushes. As long as we can't programmatically set Firebase push notifications key in the Ably SDK, we can't configure this to work properly
  • We can do testing with mocks, but in our case, I'm pretty sure the effort needed to setup mocking on Android / iOS sides would be too high to make it worth it.
  • Taking a look at implementation of push testing in and ably-java, I noticed that the whole testing there is also done with fake data and mocked services, so I doubt we can do it otherwise with Flutter wrapper. With mocking and fake data in the test suite, the Flutter wrapper doesn't really have anything to test, since everything important would end up being a mock anyway

@ikurek ikurek closed this as completed Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants