-
Notifications
You must be signed in to change notification settings - Fork 26
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
Push Admin tests #642
Conversation
@tcard The special test-only ablyChannel recipient is reset on each sandbox POST /apps request? |
@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. |
@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? |
@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. |
7530e33
to
1ec59d0
Compare
Spec/PushAdmin.swift
Outdated
realtime.push.admin.channelSubscriptions.removeWhere(params) { error in | ||
expect(error).to(beNil()) | ||
done() | ||
} | ||
} | ||
|
||
waitUntil(timeout: testTimeout) { done in | ||
delay(3) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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 😄
But we're good:
|
* 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
* 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
It doesn't compile:
The Push implementation is missing some methods.