Re: Anyone using CloudKit?

Alex Zavatone

A specific test zone, perhaps when running in the test configuration?

Do you have a helper that can detect the build configuration used to run your app?  I posted some a while ago and can repost if you want.

I’m sure you already have this though.

- Alex Zavatone

On Sep 1, 2020, at 4:32 PM, Jens Alfke <jens@...> wrote:

On Sep 1, 2020, at 10:38 AM, Jens Alfke <jens@...> wrote:

#2: How the heck does one write tests for CloudKit? The server-side environment is super test-unfriendly since there's no way to programmatically set up a clean slate.

I've come up with a solution for this: I can't erase containers/databases, but I can erase a zone by sending a delete followed by a create. That's fine for my purposes because all my code so far operates on a single zone. I just have to start each test with an erase, and make sure tests don't run concurrently. 

To scale this to multiple developers/devices/bots, I'd need to come up with a unique zone name for each device's tests.


Join to automatically receive all group messages.