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

tests(langchain-sdk): Update conftest to be able to run tests in local #18

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Yuan325
Copy link
Contributor

@Yuan325 Yuan325 commented Feb 5, 2025

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

@Yuan325 Yuan325 requested a review from a team as a code owner February 5, 2025 21:57
credentials.refresh(request)
return credentials.token
try:
# Try getting the token using gcloud (for local development)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@anubhav756 anubhav756 marked this pull request as draft March 13, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants