Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
Functional test - Add datastore query tests#281
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6284f3048777d1918b73ea71c4b24af407aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,7 +3,7 @@ Contributing | ||
| #. **Please sign one of the contributor license agreements below.** | ||
| #. Fork the repo, develop and test your code changes, add docs. | ||
| #. Make sure that your commit messages clearly describe the changes. | ||
| #. Make sure that your commit messages clearly describe the changes. | ||
| #. Send a pull request. | ||
| Here are some guidelines for hacking on gcloud-python. | ||
| @@ -16,7 +16,7 @@ using a Git checkout: | ||
| - While logged into your GitHub account, navigate to the gcloud-python repo on | ||
| GitHub. | ||
| https://github.com/GoogleCloudPlatform/gcloud-python | ||
| - Fork and clone the gcloud-python repository to your GitHub account by | ||
| @@ -130,6 +130,70 @@ Running Tests | ||
| $ cd ~/hack-on-gcloud/ | ||
| $ /usr/bin/tox | ||
| Running Regression Tests | ||
| ------------------------ | ||
| - To run regression tests you can execute:: | ||
| $ tox -e regression | ||
| or run only regression tests for a particular package via:: | ||
| $ python regression/run_regression.py --package {package} | ||
| This alone will not run the tests. You'll need to change some local | ||
| auth settings and change some configuration in your project to | ||
| run all the tests. | ||
| - Regression tests will be run against an actual project and | ||
| so you'll need to provide some environment variables to facilitate | ||
| authentication to your project: | ||
| - ``GCLOUD_TESTS_DATASET_ID``: The name of the dataset your tests connect to. | ||
| - ``GCLOUD_TESTS_CLIENT_EMAIL``: The email for the service account you're | ||
| authenticating with | ||
| - ``GCLOUD_TESTS_KEY_FILE``: The path to an encrypted key file. | ||
| See private key | ||
| `docs <https://cloud.google.com/storage/docs/authentication#generating-a-private-key>`__ | ||
| for explanation on how to get a private key. | ||
| - Examples of these can be found in ``regression/local_test_setup.sample``. We | ||
| recommend copying this to ``regression/local_test_setup``, editing the values | ||
| and sourcing them into your environment:: | ||
| $ source regression/local_test_setup | ||
| - The ``GCLOUD_TESTS_KEY_FILE`` value should point to a valid path (relative or | ||
| absolute) on your system where the key file for your service account can | ||
| be found. | ||
| - For datastore tests, you'll need to create composite | ||
| `indexes <https://cloud.google.com/datastore/docs/tools/indexconfig>`__ | ||
| with the ``gcloud`` command line | ||
| `tool <https://developers.google.com/cloud/sdk/gcloud/>`__:: | ||
| # Install the app (App Engine Command Line Interface) component. | ||
| $ gcloud components update app | ||
| # See https://cloud.google.com/sdk/crypto for details on PyOpenSSL and | ||
| # http://stackoverflow.com/a/25067729/1068170 for why we must persist. | ||
| $ export CLOUDSDK_PYTHON_SITEPACKAGES=1 | ||
| # Authenticate the gcloud tool with your account. | ||
| $ gcloud auth activate-service-account $GCLOUD_TESTS_CLIENT_EMAIL \ | ||
| > --key-file=$GCLOUD_TESTS_KEY_FILE | ||
| # Create the indexes | ||
| $ gcloud preview datastore create-indexes regression/data/ \ | ||
| > --project=$GCLOUD_TESTS_DATASET_ID | ||
| # Restore your environment to its previous state. | ||
| $ unset CLOUDSDK_PYTHON_SITEPACKAGES | ||
| - For datastore query tests, you'll need stored data in your dataset. | ||
| To populate this data, run:: | ||
| $ python regression/populate_datastore.py | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| Test Coverage | ||
| ------------- | ||
| @@ -184,4 +248,4 @@ Before we can accept your pull requests you'll need to sign a Contributor Licens | ||
| - **If you are an individual writing original source code** and **you own the intellectual property**, then you'll need to sign an `individual CLA <https://developers.google.com/open-source/cla/individual>`__. | ||
| - **If you work for a company that wants to allow you to contribute your work**, then you'll need to sign a `corporate CLA <https://developers.google.com/open-source/cla/corporate>`__. | ||
| You can sign these electronically (just scroll to the bottom). After that, we'll be able to accept your pull requests. | ||
| You can sign these electronically (just scroll to the bottom). After that, we'll be able to accept your pull requests. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| indexes: | ||
| - kind: Character | ||
| ancestor: yes | ||
| properties: | ||
| - name: appearances | ||
| - kind: Character | ||
| ancestor: yes | ||
| properties: | ||
| - name: alive | ||
| - kind: Character | ||
| ancestor: yes | ||
| properties: | ||
| - name: family | ||
| - name: appearances | ||
| - kind: Character | ||
| ancestor: yes | ||
| properties: | ||
| - name: name | ||
| - name: family |
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.