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

Push Admin tests #642

Merged
merged 19 commits into from
Dec 13, 2017
Merged

Push Admin tests #642

merged 19 commits into from
Dec 13, 2017

Conversation

ricardopereira
Copy link
Contributor

It doesn't compile:

screen shot 2017-10-27 at 00 20 42

The Push implementation is missing some methods.

@ricardopereira ricardopereira requested a review from tcard October 26, 2017 23:24
@ricardopereira
Copy link
Contributor Author

@tcard The special test-only ablyChannel recipient is reset on each sandbox POST /apps request?

@tcard
Copy link
Contributor

tcard commented Nov 3, 2017

@ricardopereira I'm not sure what you mean. Reset in which way? It posts the notification to a channel in the current Ably app, which is set anew in each POST /apps, if that's what you mean.

@ricardopereira
Copy link
Contributor Author

@tcard For example, if the sandbox resets the registered devices to 0 in the second run when I register 2 devices in the first run?

@tcard
Copy link
Contributor

tcard commented Nov 3, 2017

@ricardopereira The old registrations won't receive push notifications from the new app created when the test suite runs again, if that's the question. Everything in Ably is encapsulated by app.

realtime.push.admin.channelSubscriptions.removeWhere(params) { error in
expect(error).to(beNil())
done()
}
}

waitUntil(timeout: testTimeout) { done in
delay(3) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcard This test only passes if I put a delay between the removeWhere:params call and the list:params call. Without a delay the list:params returns 2 subscriptions instead of 0. It seems the backend needs some time to "commit" the changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ricardopereira Are you setting fullWait=true? Sorry, I should've mentioned and it's not in the spec. I set up a pushFullWait: bool client option and then, if it's on, add a fullWait=true query parameter to every push request, so that it waits for the full operation to complete. (We don't do that by default because it can be potentially a quite expensive operation.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcard Thanks. It works now as expected 😄

@ricardopereira
Copy link
Contributor Author

😒

screen shot 2017-11-09 at 10 28 52

@ricardopereira
Copy link
Contributor Author

But we're good:

Test Suite 'PushAdmin' passed at 2017-11-09 10:26:12.962.
	 Executed 22 tests, with 0 failures (0 unexpected) in 28.301 (33.053) seconds
Test Suite 'AblySpec.xctest' passed at 2017-11-09 10:26:12.963.
	 Executed 22 tests, with 0 failures (0 unexpected) in 28.301 (33.054) seconds
Test Suite 'All tests' passed at 2017-11-09 10:26:12.964.
	 Executed 22 tests, with 0 failures (0 unexpected) in 28.301 (33.058) seconds

screen shot 2017-11-09 at 10 26 19

@ricardopereira ricardopereira merged commit fea3162 into push Dec 13, 2017
@ricardopereira ricardopereira deleted the push-admin-tests branch December 13, 2017 11:06
funkyboy pushed a commit that referenced this pull request Jul 17, 2018
* MockHTTPExecutor

* PushAdmin

* Move `publish` method to Admin

* Add `get` method in PushDeviceRegistrations

* Should use response encoder type

* Fix save channel subscription

* Fix save device registration

* Better errors information

* Rename publish notification argument to data to conform specs

* Add equatable to DeviceDetails

* Fix DeviceRegistrations.get

* Add validations to PushAdmin.publish

* Fix RHS1a

* Fix RHS1b1

* Fix PushAdmin implementation

* Fix ambiguous reference to member 'dataTask(with:completionHandler:)'

* fixup! Fix PushAdmin implementation

* CI test

* fixup! Fix PushAdmin implementation
funkyboy pushed a commit that referenced this pull request Jul 27, 2018
* MockHTTPExecutor

* PushAdmin

* Move `publish` method to Admin

* Add `get` method in PushDeviceRegistrations

* Should use response encoder type

* Fix save channel subscription

* Fix save device registration

* Better errors information

* Rename publish notification argument to data to conform specs

* Add equatable to DeviceDetails

* Fix DeviceRegistrations.get

* Add validations to PushAdmin.publish

* Fix RHS1a

* Fix RHS1b1

* Fix PushAdmin implementation

* Fix ambiguous reference to member 'dataTask(with:completionHandler:)'

* fixup! Fix PushAdmin implementation

* CI test

* fixup! Fix PushAdmin implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants