tests(langchain-sdk): Update conftest to be able to run tests in local#18
Draft
tests(langchain-sdk): Update conftest to be able to run tests in local#18
Conversation
Yuan325
commented
Feb 5, 2025
| credentials.refresh(request) | ||
| return credentials.token | ||
| try: | ||
| # Try getting the token using gcloud (for local development) |
Contributor
Author
There was a problem hiding this comment.
Kurtis' comment from the other PR:
I'm not sure I agree with this flow. I think ideally it should be trying the metadata server first, and falling back to gcloud if it's unable to reach. An alternative would be use an env var to signal which to use.
Ideally, we should not rely on "gcloud auth" as it's not semantically versioned (and I've personally been bit by it changing int the past)
f989a4f to
1457ee6
Compare
1457ee6 to
d7d17bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Getting an id token from metadata server does not work on local systems. This causes test failures for auth tests locally. This PR fixes the issue.
This unblocks https://b.corp.google.com/issues/385051620