the datastore emulator is indeed slower than testbed for unit tests, but 
just as another data point, it's not way too slow for me. i routinely use 
it as part of my edit/compile/test loop on an app with a cumulative total 
of >1600 tests. around 500 of them use the datastore heavily, and running 
just those tests takes ~52s. not fast, but manageable, especially when i 
iterate on just a few relevant tests, and then expand to all of them before 
committing.

also, you don't have to entirely tear down and restart the emulator just to 
clear its data between tests. just POST to http://localhost:8089/reset (or 
whichever port you run the emulator on). example: 
https://github.com/snarfed/bridgy/blob/master/tests/testutil.py#L282-L289


On Monday, February 24, 2020 at 1:05:33 PM UTC-8, Remko Tronçon wrote:
>
> On Monday, February 24, 2020 at 9:52:25 PM UTC+1, Andrew Gorcester wrote: 
> > Cloud NDB is compatible with the Cloud Datastore Emulator; we recommend 
> tests be done using that, the same way on Cloud NDB as they would be with 
> the Cloud Datastore library. 
>
> Using an external emulator is way too slow to use for unit tests, even if 
> you are able to get all your code changed so you don’ have to tear down and 
> clean start the emulator to avoid interference between tests. This is 
> pretty disappointing, and means I (and I expect many others) will be forced 
> to rewrite everything if your app isn’t in pure maintenance mode. 
>
> Remko 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/f7c51bc3-8ac4-4979-9de8-2932393c6fdf%40googlegroups.com.

Reply via email to