You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Datastore Testing: Wiping data between tests? #1292
I'm migrating from the App Engine Datastore API to the Cloud Datastore API (so that I can connect to Datastore from a VPS). A happy thing about the previous API is that it didn't spin up a separate emulator process (5+ seconds) when helper.setUp() is called. With the Cloud Datastore API, it's a different model, so it's a little slower.
I don't want to have to entirely restart my Datastore emulator between tests, but I want a clean slate. Can I either:
Still have an in-process datastore implementation to test against, which is fast?
Clear the remote emulator datastore, so it doesn't need to be fully restarted?
I've looked through LocalDatastoreHelper, DatastoreOptions and Datastore itself, but I can't find any immediately solutions to my problem.
Note: I can't just @After and delete a set of keys, since some tests involve letting Datastore choose the id of an inserted entity
Activity
[-]Datastore Client API: [/-][+]Datastore Testing: Wiping data between tests?[/+]mitchhentges commentedon Sep 29, 2016
Fat-fingered ctrl-enter when entering the title, and posted a blank issue. It's all filled out now :)
mziccard commentedon Sep 29, 2016
@mitchhentges Thanks for the report. You are totally right
LocalDatastoreHelperis missing areset()method. I opened #1293 to fix this.In the meantime you can reset the emulator yourself by sending a
POSTrequest tohttp://<host>:<port>/reset.Edouard360 commentedon May 4, 2019
I get a java.lang.NullPointerException when doing:
curl -X POST http://localhost:8081/reset
I'm with version 2.1.0...
│ Cloud Datastore Emulator │ 2.1.0 │ 18.4 MiB │
EDIT: Oh I now realize it works with the flag no-store-on-disk:
gcloud beta emulators datastore start --no-store-on-disk
gertcuykens commentedon Jan 11, 2020
Still null pointer exception without flag --no-store-on-disk. Why can't this be a more clear error message?
deps: update dependency com.google.api.grpc:proto-google-cloud-pubsub…
chore(main): release 3.5.0 (#1305)
deps: update dependency com.google.cloud:google-cloud-logging to v3.1…
chore(main): release 0.131.4-alpha (#1293)
test(deps): update dependency com.google.truth:truth to v1.3.0 (#1292)
chore: update requirements.txt to address dependabot security alerts (g…
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
chore(main): release 1.120.19-SNAPSHOT (#1292)
chore(main): release 1.120.19-SNAPSHOT (#1292)
chore: Disable CLIRR checks on releas (googleapis#1474) (googleapis#1292