Skip to content

Commit 28cd7b0

Browse files
tswastJon Wayne Parrott
authored andcommitted
Add missing instructions for test project setup. (#368)
Also, update the script to prepare a new project for testing.
1 parent 44d58cd commit 28cd7b0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

TESTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ The script will also instruct you to follow a URL to enable APIs. You will need
3232

3333
From the Cloud Console, create a new Service Account and download its json key. Place this file in `testing/resources/service-account.json`.
3434

35+
Create a new OAuth client ID. Create a file `testing/resources/client-secrets.json` and write the `client_id` and `client_secret` to the file in the [Client Secrets JSON format](https://developers.google.com/api-client-library/python/guide/aaa_client_secrets).
36+
3537
## Environment variables
3638

3739
* Copy `testing/resources/test-env.tmpl.sh` to `testing/resources/test-env.sh`, and updated it with your configuration.
3840
* Run `source testing/resources/test-env.sh`.
3941
* Run `export GOOGLE_APPLICATION_CREDENTIALS=testing/resources/service-account.json`.
42+
* Run `export GOOGLE_CLIENT_SECRETS=testing/resources/client-secrets.json`.
4043

4144
### Test environments
4245

scripts/prepare-testing-project.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ gsutil defacl set public-read gs://$GCLOUD_PROJECT
2525
echo "Creating bigquery resources."
2626
gcloud alpha bigquery datasets create test_dataset
2727
gcloud alpha bigquery datasets create ephemeral_test_dataset
28-
gsutil cp tests/resources/data.csv gs://$GCLOUD_PROJECT/data.csv
28+
gsutil cp bigquery/api/resources/data.csv gs://$GCLOUD_PROJECT/data.csv
2929
gcloud alpha bigquery import \
3030
gs://$GCLOUD_PROJECT/data.csv \
3131
test_dataset/test_table \
32-
--schema-file tests/resources/schema.json
32+
--schema-file bigquery/api/resources/schema.json
3333

3434
echo "Creating datastore indexes."
3535
gcloud preview app deploy -q datastore/api/index.yaml
@@ -38,4 +38,4 @@ echo "Creating pubsub resources."
3838
gcloud alpha pubsub topics create gae-mvm-pubsub-topic
3939

4040
echo "To finish setup, follow this link to enable APIs."
41-
echo "https://console.cloud.google.com/flows/enableapi?apiid=datastore,pubsub,storage_api,logging,plus,bigquery,cloudmonitoring,compute_component"
41+
echo "https://console.cloud.google.com/flows/enableapi?project=${GCLOUD_PROJECT}&apiid=bigquery,cloudmonitoring,compute_component,datastore,datastore.googleapis.com,dataproc,dns,plus,pubsub,logging,storage_api,vision.googleapis.com"

0 commit comments

Comments
 (0)