From 363fe305e9ce34a6cd53951c6ee5f997094b54ee Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Mon, 21 Dec 2020 13:21:29 -0800 Subject: [PATCH] docs: add instructions for authenticating for system tests (#872) * docs: add instructions for authenticating for system tests * docs: add phrasing change to README --- .../gcp/templates/node_library/CONTRIBUTING.md | 15 +++++++++++++-- synthtool/gcp/templates/node_library/README.md | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/synthtool/gcp/templates/node_library/CONTRIBUTING.md b/synthtool/gcp/templates/node_library/CONTRIBUTING.md index f6c4cf010..e8f43fd39 100644 --- a/synthtool/gcp/templates/node_library/CONTRIBUTING.md +++ b/synthtool/gcp/templates/node_library/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. +### Before you begin + +1. [Select or create a Cloud Platform project][projects].{% if metadata['repo']['requires_billing'] %} +1. [Enable billing for your project][billing].{% endif %} {% if metadata['repo']['api_id'] %} +1. [Enable the {{ metadata['repo']['name_pretty'] }} API][enable_api]. {% endif %} +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + ## Running the tests 1. [Prepare your environment for Node.js setup][setup]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. npm run fix [setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +{% if metadata['repo']['api_id'] %}[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid={{ metadata['repo']['api_id'] }}{% endif %} +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/synthtool/gcp/templates/node_library/README.md b/synthtool/gcp/templates/node_library/README.md index df1cf6b1c..c72238b75 100644 --- a/synthtool/gcp/templates/node_library/README.md +++ b/synthtool/gcp/templates/node_library/README.md @@ -75,8 +75,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. {% if metadata['samples']|length %} ## Samples -Samples are in the [`samples/`](https://github.com/{{ metadata['repo']['repo'] }}/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/{{ metadata['repo']['repo'] }}/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ |