Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (24 loc) · 1.18 KB

README.md

File metadata and controls

40 lines (24 loc) · 1.18 KB

Datastore Emulator Tests

These are tests that require Datastore to run. The Datastore Emulator allows us to run these tests with some environment modifications.

See https://cloud.google.com/datastore/docs/tools/datastore-emulator

Running Locally

One time setup

Do the one time setup of installing the Datastore Emulator.

gcloud components install cloud-datastore-emulator

Python2 Environment

Datastore emulator must be run with python2. The Datastore Emulator does not currently have support for running with python3.

Similar to virtualenv setup in the head README, make sure you have a python2 available. python2 --version

And create a virtualenv environment for python2.

virtualenv -p python2 env2

Activate the environment to run the datastore emulator.

source env2/bin/activate

Testing

Start the emulator:

./tests/datastore_emulator/run_emulator.sh

In another terminal, run the test script. Note that this sets (and attempts to unset) environment variables.

./tests/datastore_emulator/test.sh

To kill the Datastore emulator, use jps -v to get its process id and then kill it. Control-C will not kill a running Datastore emulator.