tests: system tests for expired User Credentials#1937
Conversation
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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
nit: Should this be marked as "tests: ..." instead of "fix: ..."? Otherwise, LGTM. |
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_CREDENTIALSenvironment 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 withRefreshErrorinstead of ignoring it as intended.Changes:
isinstancecheck forgoogle.oauth2.credentials.Credentialsto robustly identify User Credentials.invalid_clientto the list of ignored error messages, as this error can also occur with invalid tokens.PR created automatically by Jules for task 13051961428180802207 started by @chalmerlowe