-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How can we cover unit testing for datastore? #2
Comments
You could use |
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). |
Yes, it is embedding the App Engine Java development server and running the same servlet that is running in production.
You would have to handle the Keep in mind that |
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. |
#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'). |
#106 exists to cover the deficiencies of testing with stubbed / mocked backends. |
* Defend against back-end returning instance configs for disallowed regions. * Additional system tests for 'Snapshot.read': - Read single key. - Read multiple keys. - Read open-closed ranges. - Read open-open ranges. - Read closed-open ranges. - Read closed-closed ranges. - Read timestamp. - Min read timestamp. - Max staleness. - Exact staleness. - Strong. * Additional system tests for 'Snapshot.execute_sql': - Query returning 'ARRAY<STRUCT>'. - Bind INT64 parameter to null.
* Defend against back-end returning instance configs for disallowed regions. * Additional system tests for 'Snapshot.read': - Read single key. - Read multiple keys. - Read open-closed ranges. - Read open-open ranges. - Read closed-open ranges. - Read closed-closed ranges. - Read timestamp. - Min read timestamp. - Max staleness. - Exact staleness. - Strong. * Additional system tests for 'Snapshot.execute_sql': - Query returning 'ARRAY<STRUCT>'. - Bind INT64 parameter to null.
* Defend against back-end returning instance configs for disallowed regions. * Additional system tests for 'Snapshot.read': - Read single key. - Read multiple keys. - Read open-closed ranges. - Read open-open ranges. - Read closed-open ranges. - Read closed-closed ranges. - Read timestamp. - Min read timestamp. - Max staleness. - Exact staleness. - Strong. * Additional system tests for 'Snapshot.execute_sql': - Query returning 'ARRAY<STRUCT>'. - Bind INT64 parameter to null.
* Defend against back-end returning instance configs for disallowed regions. * Additional system tests for 'Snapshot.read': - Read single key. - Read multiple keys. - Read open-closed ranges. - Read open-open ranges. - Read closed-open ranges. - Read closed-closed ranges. - Read timestamp. - Min read timestamp. - Max staleness. - Exact staleness. - Strong. * Additional system tests for 'Snapshot.execute_sql': - Query returning 'ARRAY<STRUCT>'. - Bind INT64 parameter to null.
add GB timezone
update janscas changes
* chore: update documentation link in README * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md * coverage * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ## 0.1.0 (2021-03-15) ### Features * generate v1alpha ([2c025f8](https://www.github.com/googleapis/python-dataproc-metastore/commit/2c025f80c7791ef864ce2bf655429e1ecf40d288)) * generate v1beta ([942ddcd](https://www.github.com/googleapis/python-dataproc-metastore/commit/942ddcd6ddd18bd6d79cf2c57685a743ea35a376)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ### [0.1.1](https://www.github.com/googleapis/python-notebooks/compare/v0.1.0...v0.1.1) (2020-08-06) ### Bug Fixes * fix package name ([#2](https://www.github.com/googleapis/python-notebooks/issues/2)) ([ae80dcf](https://www.github.com/googleapis/python-notebooks/commit/ae80dcffc544a31096e9f076e9538985c1b3a44f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Mon Jan 11 09:43:06 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 16ec872dd898d7de6e1822badfac32484b5d9031 Source-Link: googleapis/synthtool@16ec872
Fixes #2 🦕 This PR adds the auto generated `v3` client for Resource Manager and changes the release status from `alpha` to `beta`. This is a significant change from the previous version `v1beta1`, as this is the first version of an auto generated client. chore(release_status): upgrade release status from alpha to beta fix: remove v1beta1 chore(deps): require python 3.6+
* chore: add SECURITY.md * chore: use a valid post processor image * 🦉 Updates from OwlBot Co-authored-by: google-cloud-policy-bot[bot] <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 0.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove python 3.6 sample configs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require google-api-core >= 2.8.0 Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore(main): release 0.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * use latest post processor image * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require google-api-core >= 2.8.0 * remove python 3.6 sample configs Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* chore(main): release 0.1.0 * add commit to trigger gh actions * add commit to trigger gh actions Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
- [ ] Regenerate this pull request now. chore: fix snippet region tag format chore: fix docstring code block formatting PiperOrigin-RevId: 430730865 Source-Link: googleapis/googleapis@ea58002 Source-Link: googleapis/googleapis-gen@ca893ff Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2E4OTNmZjhhZjI1ZmM3ZmUwMDFkZTE0MDVhNTE3ZDgwNDQ2ZWNjYSJ9
* updated CHANGELOG.md [ci skip] * updated setup.cfg [ci skip] * updated setup.py [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore: add split repo templates * test: increase coverage values
Fix the development status classifier to be consistent with 'alpha' in the README. Also fixes some docs related kokoro configs. The `docs/docs.cfg` job that is triggered by successfulrelease jobs was failing because `NOX_SESSION` was in the required env vars list.
🤖 I have created a release \*beep\* \*boop\* --- ## [0.2.0](https://www.github.com/googleapis/python-compute/compare/v0.1.0...v0.2.0) (2021-02-11) ### Features * run synthtool to pick up mtls feature ([#6](https://www.github.com/googleapis/python-compute/issues/6)) ([3abec21](https://www.github.com/googleapis/python-compute/commit/3abec21a1d5b1384779c48b899f23ba18ca0ddb3)) ### Bug Fixes * don't use integers for enums in json encoding ([a3685b5](https://www.github.com/googleapis/python-compute/commit/a3685b5a03a75256d2d00b89dcc8fda34596edde)) * fix body encoding for rest transport ([#17](https://www.github.com/googleapis/python-compute/issues/17)) ([a3685b5](https://www.github.com/googleapis/python-compute/commit/a3685b5a03a75256d2d00b89dcc8fda34596edde)) * regenerate the client lib ([#9](https://www.github.com/googleapis/python-compute/issues/9)) ([b9def52](https://www.github.com/googleapis/python-compute/commit/b9def52a47067804d5b79e867fb3ff895f8f4c21)) * set development status classifier to alpha ([#2](https://www.github.com/googleapis/python-compute/issues/2)) ([54814f8](https://www.github.com/googleapis/python-compute/commit/54814f8ad15b8f8dff051c7c7819bc4a7b8e099f)) * stabilize order of query_params ([a3685b5](https://www.github.com/googleapis/python-compute/commit/a3685b5a03a75256d2d00b89dcc8fda34596edde)) * update paging implementation to handle unconventional pagination ([a3685b5](https://www.github.com/googleapis/python-compute/commit/a3685b5a03a75256d2d00b89dcc8fda34596edde)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
PiperOrigin-RevId: 381356178 Source-Link: googleapis/googleapis@6fa6c00 Source-Link: googleapis/googleapis-gen@ba89d92
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
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?
The text was updated successfully, but these errors were encountered: