GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Using gcloud datastore with a local devserver · Issue #639 · googleapis/google-cloud-python

Using gcloud datastore with a local devserver #639

New issue
Copy link
New issue
Copy link
Closed
Closed
Using gcloud datastore with a local devserver#639
Copy link
Assignees
dhermes
Labels
api: datastoreIssues related to the Datastore API.testing
Milestone
Datastore Future

Description

@twumdjin
twumdjin
opened on Feb 13, 2015
Issue body actions

Issue #2 claims that the library uses the configuration specified for GCD - https://developers.google.com/datastore/docs/tools/devserver - but I don't believe this to be the case.

As far as I can tell from reading the code, there's actually no way to get the gcloud datastore library to talk to a local datastore devserver. The endpoint has a hardcoded value - API_BASE_URL.

Are there any plans to make this configurable?

Activity

  1. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    testing
    on Feb 13, 2015
  2. dhermes
    added this to the Datastore Future milestone on Feb 13, 2015
  3. dhermes commented on Feb 13, 2015

    @dhermes
    dhermes
    on Feb 13, 2015
    Contributor
    More actions

    Nothing concrete but it's something we'd like to do. We've had some private discussions about supporting GCD.

    As for #2, we opted to just unit test without any actual HTTP calls and then talk to the real service in our regression/ tests.

  4. dhermes commented on Feb 13, 2015

    @dhermes
    dhermes
    on Feb 13, 2015
    Contributor
    More actions

    @twumdjin You are interested in GCD for integration tests for an application? Can you provide more details?

  5. twumdjin commented on Feb 13, 2015

    @twumdjin
    twumdjin
    on Feb 13, 2015
    Author
    More actions

    I'm interested in using gcd for development. I guess I could set up a separate project just for that. In either case having a separate datastore from prod (and ideally running locally) would provide isolation during the dev process, where everything is still very much in flux.
    I assume teams with more than 1 developer would also want this.

    In the interim I'm using environment specific logic to patch the base api url in development so that it talks to the gcd devserver. It's pretty ugly but it should do for now. :(

    My project is still small so I'm doing unit testing and regression testing on a stub datastore I hacked together. Again environment variables and factory methods make this possible. I saw the comment on the other thread about stubbing at the network layer. I'm somewhat opposed to that because it requires me to understand too much of Google datastore's wire protocol, which frankly is something I'm trying to avoid by depending on an abstraction like the gcloud library in the first place.

    It would be nice if there was an in-memory stub solution like the one for AppEngine testing but I'm comfortable depending on my own stub at my current scale.

  6. dhermes commented on Feb 13, 2015

    @dhermes
    dhermes
    on Feb 13, 2015
    Contributor
    More actions
    1. Yes, for now it seems that something like
    from gcloud import datastore
    
    connection = datastore.get_connection()
    connection.API_BASE_URL = 'http://localhost:8080'
    
    datastore.set_defaults(connection=connection)
    
    # Drivers start your engines

    is a fine hack for testing locally.

    In terms of dev and testing, this minimizes the number of if statements you need and the logic can be encapsulated in a custom module.


    1. I don't recommend the hack from How can we cover unit testing for datastore? #2 about stubbing out the network. It's not worth the time.

    1. An in memory stub seems like a great idea, but I'm not sure if it should be part of the library, a separate repo, or something else. Maybe setuptools extras? i.e. pip install gcloud[testing].
  7. dhermes
    added a commit that references this issue on Feb 14, 2015

    Removing unused _EMPTY sentinel from base Connection.

    73650fd
  8. tseaver commented on Feb 14, 2015

    @tseaver
    tseaver
    on Feb 14, 2015
    Contributor
    More actions

    I'm not sure how setuptools extras comes into play: that command would only cause extra dependencies to be installed, i.e. those declared via:

    setup(...
        extras_require={'testing': ['foo', 'bar', 'baz']},
    )

    You can have console scripts which depend on extras and have them added to the path when they run..

  9. dhermes commented on Feb 14, 2015

    @dhermes
    dhermes
    on Feb 14, 2015
    Contributor
    More actions

    That link is exactly what I meant. Thanks for the add.

  10. dhermes commented on Aug 28, 2015

    @dhermes
    dhermes
    on Aug 28, 2015
    Contributor
    More actions

    Closing this since the behavior is "tracked" in googleapis/google-cloud-datastore#21

  11. dhermes
    closed this as completedon Aug 28, 2015
  12. JustinBeckwith
    assigned
    dhermes
    on Feb 1, 2021
  13. parthea
    added a commit that references this issue on Aug 21, 2025

    chore(deps): update all dependencies (#639)

    ab949bb
  14. parthea
    added a commit that references this issue on Sep 16, 2025

    chore(deps): update all dependencies (#639)

    aadd808
  15. parthea
    added 6 commits that reference this issue on Nov 24, 2025

    refactor: move generator.options into utils module (#639)

    cfad9ec

    chore: Bump gapic-generator-python version to 1.3.0 (#639)

    268d9aa

    fix: mimic the pubsub test to clean up bigquery datasets (#639)

    e350bb1

    chore: add yoshi-python to CODEOWNERS (#639)

    49c1999

    fix: mimic the pubsub test to clean up bigquery datasets (#639)

    4cfb160

    build: use pypi secret from secret manager (#639)

    f81ce4a
  16. parthea
    added 6 commits that reference this issue on Mar 2, 2026

    chore: allow releases from previous major versions (#639)

    96819e8

    chore(deps): update dependency google-cloud-bigquery to v2.15.0 (#639)

    b75f430

    test: duplicate table error class fix (#639)

    3b5f0b6

    feat: support schemas in queries and dml statements (#639)

    e2a0d90

    docs: add README to samples subdirectory (#639)

    cadece1

    chore: release 1.43.0 (#618)

    81a408a
  17. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

api: datastoreIssues related to the Datastore API.testing

Type

No type

Projects

No projects

    Milestone

    • Datastore Future

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.