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

Datastore Testing: Wiping data between tests? #1292

Closed
mitchhentges opened this issue Sep 29, 2016 · 4 comments · Fixed by #1293
Closed

Datastore Testing: Wiping data between tests? #1292

mitchhentges opened this issue Sep 29, 2016 · 4 comments · Fixed by #1293
Assignees

Comments

@mitchhentges
Copy link

mitchhentges commented Sep 29, 2016

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

@mitchhentges mitchhentges changed the title Datastore Client API: Datastore Testing: Wiping data between tests? Sep 29, 2016
@mitchhentges
Copy link
Author

Fat-fingered ctrl-enter when entering the title, and posted a blank issue. It's all filled out now :)

@mziccard
Copy link
Contributor

@mitchhentges Thanks for the report. You are totally right LocalDatastoreHelper is missing a reset() method. I opened #1293 to fix this.

In the meantime you can reset the emulator yourself by sending a POST request to http://<host>:<port>/reset.

@Edouard360
Copy link

Edouard360 commented 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
Copy link

Still null pointer exception without flag --no-store-on-disk. Why can't this be a more clear error message?

github-actions bot pushed a commit that referenced this issue Aug 9, 2022
…-v1 to v1.102.10 (#1292)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.api.grpc:proto-google-cloud-pubsub-v1](https://togithub.com/googleapis/java-pubsub) | `1.102.9` -> `1.102.10` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-pubsub-v1/1.102.10/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-pubsub-v1/1.102.10/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-pubsub-v1/1.102.10/compatibility-slim/1.102.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-pubsub-v1/1.102.10/confidence-slim/1.102.9)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjMyLjE0My4xIn0=-->
github-actions bot pushed a commit that referenced this issue Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


## [3.5.0](googleapis/java-asset@v3.4.2...v3.5.0) (2022-08-09)


### Features

* Remove v1p4beta1 API protos. v1p4beta1 has been deprecated and announced through MSA. This is the cleanup ([ebab5c6](googleapis/java-asset@ebab5c6))


### Dependencies

* update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.3.0 ([#1257](googleapis/java-asset#1257)) ([c61c0e8](googleapis/java-asset@c61c0e8))
* update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v2.5.1 ([#1279](googleapis/java-asset#1279)) ([5995764](googleapis/java-asset@5995764))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.10 ([#1292](googleapis/java-asset#1292)) ([76f886e](googleapis/java-asset@76f886e))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.9 ([#1280](googleapis/java-asset#1280)) ([a35d490](googleapis/java-asset@a35d490))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.0 ([#1272](googleapis/java-asset#1272)) ([60763d4](googleapis/java-asset@60763d4))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#1274](googleapis/java-asset#1274)) ([8b4efa5](googleapis/java-asset@8b4efa5))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.2 ([#1294](googleapis/java-asset#1294)) ([ff76d3a](googleapis/java-asset@ff76d3a))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 ([#1296](googleapis/java-asset#1296)) ([4c2a6ec](googleapis/java-asset@4c2a6ec))
* update dependency com.google.cloud:google-cloud-core to v2.8.3 ([#1273](googleapis/java-asset#1273)) ([1ad7821](googleapis/java-asset@1ad7821))
* update dependency com.google.cloud:google-cloud-core to v2.8.4 ([#1275](googleapis/java-asset#1275)) ([a45d90c](googleapis/java-asset@a45d90c))
* update dependency com.google.cloud:google-cloud-core to v2.8.5 ([#1276](googleapis/java-asset#1276)) ([985d6e6](googleapis/java-asset@985d6e6))
* update dependency com.google.cloud:google-cloud-core to v2.8.6 ([#1283](googleapis/java-asset#1283)) ([26f527c](googleapis/java-asset@26f527c))
* update dependency com.google.cloud:google-cloud-core to v2.8.7 ([#1285](googleapis/java-asset#1285)) ([fe40190](googleapis/java-asset@fe40190))
* update dependency com.google.cloud:google-cloud-core to v2.8.8 ([#1288](googleapis/java-asset#1288)) ([566e032](googleapis/java-asset@566e032))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.1 ([#1229](googleapis/java-asset#1229)) ([dcc463c](googleapis/java-asset@dcc463c))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.10 ([#1293](googleapis/java-asset#1293)) ([d6188ca](googleapis/java-asset@d6188ca))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.9 ([#1281](googleapis/java-asset#1281)) ([79d5a3c](googleapis/java-asset@79d5a3c))
* update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.0 ([#1261](googleapis/java-asset#1261)) ([1cca78c](googleapis/java-asset@1cca78c))
* update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.2 ([#1287](googleapis/java-asset#1287)) ([a399744](googleapis/java-asset@a399744))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1277](googleapis/java-asset#1277)) ([7a27f49](googleapis/java-asset@7a27f49))
* update dependency com.google.cloud:google-cloud-storage to v2.10.0 ([#1282](googleapis/java-asset#1282)) ([66ba2ad](googleapis/java-asset@66ba2ad))
* update dependency com.google.cloud:google-cloud-storage to v2.11.0 ([#1286](googleapis/java-asset#1286)) ([4df8988](googleapis/java-asset@4df8988))
* update dependency com.google.cloud:google-cloud-storage to v2.11.1 ([#1291](googleapis/java-asset#1291)) ([3af9102](googleapis/java-asset@3af9102))
* update dependency com.google.cloud:google-cloud-storage to v2.11.2 ([#1295](googleapis/java-asset#1295)) ([693d42b](googleapis/java-asset@693d42b))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants