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 — How can we cover unit testing for datastore? · Issue #2 · googleapis/google-cloud-python

How can we cover unit testing for datastore? #2

New issue
Copy link
New issue
Copy link
Closed
Closed
How can we cover unit testing for datastore?#2
Copy link
Assignees
tseaver
Labels
api: datastoreIssues related to the Datastore API.testingtype: questionRequest for information or clarification. Not an issue.

Description

@jgeewax
jgeewax
opened on Jan 29, 2014
Issue body actions

Right now, the only way to develop this is by hitting the live Cloud Datastore API. Is there a way we can use these API calls in unit tests without mocking?

Can we have a "local datastore" server that understands the API and makes it easy for local development?

Activity

Next
  1. proppy commented on Jan 29, 2014

    @proppy
    proppy
    on Jan 29, 2014
    Contributor
    More actions

    You could use gcd: the local development server, see:
    https://developers.google.com/datastore/docs/tools/devserver

  2. jgeewax commented on Jan 30, 2014

    @jgeewax
    jgeewax
    on Jan 30, 2014
    ContributorAuthor
    More actions

    That looks good for local development. It runs on Java right ?

    I wonder how difficult it would be to patch in the stubs from AppEngine's dev_appserver.py so that i can use something akin to ext.testbed to unittest locally (ie, without hitting the wire, stay all in Python).

  3. proppy commented on Jan 30, 2014

    @proppy
    proppy
    on Jan 30, 2014
    Contributor
    More actions

    That looks good for local development. It runs on Java right ?

    Yes, it is embedding the App Engine Java development server and running the same servlet that is running in production.

    I wonder how difficult it would be to patch in the stubs from AppEngine's dev_appserver.py so that i can use something akin to ext.testbed to unittest locally (ie, without hitting the wire, stay all in Python).

    You would have to handle the datastore_v1.proto to datastore_v4 convertion somehow.

    Keep in mind that datastore_v4 private interface is not really documented and also subject to change: datastore_v1 is the public versionned interface.

  4. jgeewax commented on Jan 30, 2014

    @jgeewax
    jgeewax
    on Jan 30, 2014
    ContributorAuthor
    More actions

    Yikes. Well I realllly don't want to force people to spin up a local server in order to run unit tests...

    We'll have to come up with a way to stub this out.

  5. jgeewax
    added
    testing
    on May 1, 2014
  6. tseaver commented on Sep 23, 2014

    @tseaver
    tseaver
    on Sep 23, 2014
    Contributor
    More actions

    #130 adds 100% unit test coverage for modules in gcloud, gcloud.datastore. I would call its strategy "stubbing" (testcases explicitly stub out the http or connection objects) rather than "mocking" (using a general-purpose utilitiy like 'mock').

  7. tseaver commented on Oct 17, 2014

    @tseaver
    tseaver
    on Oct 17, 2014
    Contributor
    More actions

    #106 exists to cover the deficiencies of testing with stubbed / mocked backends.

  8. tseaver
    closed this as completedon Oct 17, 2014
  9. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  10. tseaver
    added a commit that references this issue on Jul 12, 2017

    Spanner p0 system tests (batch #2) (#3604)

    66a9258
  11. landrito
    added 3 commits that reference this issue on Aug 21, 2017

    Spanner p0 system tests (batch googleapis#2) (googleapis#3604)

    3e9abfb

    Spanner p0 system tests (batch googleapis#2) (googleapis#3604)

    f01ef39

    Spanner p0 system tests (batch googleapis#2) (googleapis#3604)

    2d463a5
  12. davidebelloni
    added a commit that references this issue on Dec 7, 2017

    Storage: sourceGeneration in copy_blob googleapis#4533 - BugFix googl…

    2107fce
  13. 83 remaining items

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

    test: No warnings (#9)

    This issue will close once commit 7ae7c34 is merged into the 'main' branch.
    7ae7c34

    chore: release 0.32.0 (#2)

    This issue will close once commit 5d3931f is merged into the 'main' branch.
    5d3931f

    Chore: Added templated files from Owlbot (#2)

    This issue will close once commit 7cdc1f2 is merged into the 'main' branch.
    7cdc1f2

    chore: release 1.6.2 (#2)

    This issue will close once commit 36520a2 is merged into the 'main' branch.
    36520a2

    chore: add split repo templates (#2)

    This issue will close once commit 75815a6 is merged into the 'main' branch.
    75815a6

    Implement ``Model.query``. (#59)

    This issue will close once commit 0518be5 is merged into the 'main' branch.
    0518be5
  15. parthea
    added 8 commits that reference this issue on Mar 6, 2026

    translator: package to translate dialects

    7819da7

    feat(sqlalchemy): implement dialect's minimal functionality (#2)

    5cf9065

    feat: add types compiler and introspection methods (#2)

    6b6e039

    feat: add OpenTelemetry Tracing support as a preview feature (#1288)

    7ca369a

    Spanner p0 system tests (batch #2) (#3604)

    89fbcc6

    chore: release 1.14.0 (#2)

    2734543

    feat: add support for Point In Time Recovery (PITR) (#148)

    d424356

    chore: add python repo templates (#2)

    b6399c2
  16. parthea
    added a commit that references this issue on Apr 1, 2026

    Revert "fix: Update max_instances default to reflect actual value (#2… (

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: datastoreIssues related to the Datastore API.testingtype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    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.