Skip to content
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

test: add test for x-goog-user-project header #1889

Merged
merged 4 commits into from Dec 9, 2019
Merged

test: add test for x-goog-user-project header #1889

merged 4 commits into from Dec 9, 2019

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Nov 26, 2019

Adds a smoke test for x-goog-user-project header being populated when calling:

  // This method looks for the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS
  // environment variables.
  const auth = new google.auth.GoogleAuth({
    // Scopes can be specified either as an array or as a single, space-delimited string.
    scopes: ['https://www.googleapis.com/auth/compute']
  });
  const authClient = await auth.getClient();

  // obtain the current project Id
  const project = await auth.getProjectId();

  // Fetch the list of GCE zones within a project.
  const res = await compute.zones.list({ project, auth: authClient });
  console.log(res.data);

Depends on googleapis/google-auth-library-nodejs#837 landing, and being pulled into googleapis-common as a dependency.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 26, 2019
@bcoe bcoe added status: blocked Resolving the issue is dependent on other work. and removed cla: yes This human has signed the Contributor License Agreement. labels Nov 26, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 26, 2019
@bcoe
Copy link
Contributor Author

bcoe commented Nov 26, 2019

blocked on landing updates to googleapis-common and google-auth-library-nodejs.

@codecov
Copy link

codecov bot commented Dec 6, 2019

Codecov Report

Merging #1889 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1889   +/-   ##
=======================================
  Coverage   96.41%   96.41%           
=======================================
  Files           2        2           
  Lines         418      418           
  Branches        7        7           
=======================================
  Hits          403      403           
  Misses         15       15

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cdc823...78ea55f. Read the comment docs.

@broady
Copy link

broady commented Dec 6, 2019

FWIW if you want to do a smoke test use the translation API and set the quota project to something nonsense and you should get an error back.

@bcoe bcoe merged commit 2aefeae into master Dec 9, 2019
@bcoe bcoe removed the status: blocked Resolving the issue is dependent on other work. label Dec 9, 2019
@JustinBeckwith JustinBeckwith deleted the project-id branch December 13, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants