Skip to content

Commit

Permalink
switch from gcloud datastore emulator to firestore emulator
Browse files Browse the repository at this point in the history
...since the datastore emulator evidently doesn't support != query filters: googleapis/python-ndb#962
  • Loading branch information
snarfed committed Apr 17, 2024
1 parent 296ffb4 commit 2892e7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
- run:
name: Run tests
command: |
CLOUDSDK_CORE_PROJECT=oauth-dropins gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 < /dev/null >& /dev/null &
sleep 5s
python3 -m coverage run --include=oauth_dropins/webutil/handlers.py,oauth_dropins/webutil/models.py,oauth_dropins/webutil/util.py -m unittest discover -v -p 'test_*.py'
kill %1
python3 -m coverage html -d /tmp/coverage_html
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ Development
---
Pull requests are welcome! Feel free to [ping me in #indieweb-dev](https://indieweb.org/discuss) with any questions.

First, fork and clone this repo. Then, install the [Google Cloud SDK](https://cloud.google.com/sdk/) and run `gcloud components install beta cloud-datastore-emulator` to install the [datastore emulator](https://cloud.google.com/datastore/docs/tools/datastore-emulator). Then, set up your environment by running these commands in the repo root directory. Once you have them, set up your environment by running these commands in the repo root directory:
First, fork and clone this repo. Then, install the [Google Cloud SDK](https://cloud.google.com/sdk/) and run `gcloud components install cloud-firestore-emulator` to install the [Firestore emulator](https://cloud.google.com/firestore/docs/emulator). Once you have them, set up your environment by running these commands in the repo root directory:


```shell
gcloud config set project oauth-dropins
Expand All @@ -361,7 +362,7 @@ pip install -r requirements.txt
Run the demo app locally with [`flask run`](https://flask.palletsprojects.com/en/2.0.x/cli/#run-the-development-server):

```shell
gcloud beta emulators datastore start --use-firestore-in-datastore-mode --no-store-on-disk --host-port=localhost:8089 --quiet < /dev/null >& /dev/null &
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
GAE_ENV=localdev FLASK_ENV=development flask run -p 8080
```

Expand All @@ -379,10 +380,9 @@ Here's how to package, test, and ship a new release. (Note that this is [largely
1. Run the unit tests.
```sh
source local/bin/activate.csh
gcloud beta emulators datastore start --use-firestore-in-datastore-mode --no-store-on-disk --host-port=localhost:8089 < /dev/null >& /dev/null &
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
sleep 2s
DATASTORE_EMULATOR_HOST=localhost:8081 DATASTORE_DATASET=oauth-dropins \
python3 -m unittest discover
python3 -m unittest discover
kill %1
deactivate
```
Expand Down

0 comments on commit 2892e7c

Please sign in to comment.