Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

tests: system tests for expired User Credentials#1937

Merged
chalmerlowe merged 3 commits intomainfrom
jules-13051961428180802207-95fbd6c5
Jan 15, 2026
Merged

tests: system tests for expired User Credentials#1937
chalmerlowe merged 3 commits intomainfrom
jules-13051961428180802207-95fbd6c5

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This PR fixes flaky system tests that fail when google.auth.default() picks up expired User Credentials.

The previous logic only exempted failures if the GOOGLE_APPLICATION_CREDENTIALS environment variable pointed to a file ending in "authorized_user.json". However, User Credentials can be loaded from other locations (e.g., gcloud config), causing the test to fail with RefreshError instead of ignoring it as intended.

Changes:

  • Added isinstance check for google.oauth2.credentials.Credentials to robustly identify User Credentials.
  • Added invalid_client to the list of ignored error messages, as this error can also occur with invalid tokens.
  • Applied these fixes to both sync and async system tests.

PR created automatically by Jules for task 13051961428180802207 started by @chalmerlowe

Updates `system_tests_sync/test_default.py` and `system_tests_async/test_default.py` to correctly identify and exempt `google.oauth2.credentials.Credentials` (User Credentials) from failures caused by expired or invalid tokens (`invalid_grant`, `invalid_client`). This prevents system tests from failing when running with expired default user credentials in local or CI environments.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chalmerlowe chalmerlowe self-assigned this Jan 14, 2026
@chalmerlowe chalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 14, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 14, 2026
@chalmerlowe chalmerlowe marked this pull request as ready for review January 15, 2026 10:24
@chalmerlowe chalmerlowe requested a review from a team January 15, 2026 10:24
@chalmerlowe chalmerlowe requested a review from a team as a code owner January 15, 2026 10:24
@chalmerlowe chalmerlowe changed the title Fix system tests for expired User Credentials fix: system tests for expired User Credentials Jan 15, 2026
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

LGTM

@gkevinzheng
Copy link
Copy Markdown
Contributor

nit: Should this be marked as "tests: ..." instead of "fix: ..."? Otherwise, LGTM.

@parthea parthea changed the title fix: system tests for expired User Credentials tests: system tests for expired User Credentials Jan 15, 2026
@chalmerlowe chalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 15, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 15, 2026
@chalmerlowe chalmerlowe merged commit e5a28b5 into main Jan 15, 2026
24 checks passed
@chalmerlowe chalmerlowe deleted the jules-13051961428180802207-95fbd6c5 branch January 15, 2026 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants