Repository navigation
Fix BigQuery test credential selection and cleanup - #127
danielmawhirter wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Change map
Observed failure: the two restricted BigQuery permission tests required Smallest sufficient repair: classify the input credential file, preserve the existing per-identity selection for stored keys, and scope all setup side effects to the decorated test. No workflow, fixture-selection, or production connector changes are included. Focused verification: 33 tests passed from the fresh-main worktree using the installed Python 3.14 environment and explicit current-checkout package paths. Independent rerun, flake8, isort, and diff whitespace checks passed. Live provider behavior remains unverified. Stopping condition: credential-type selection and state/file isolation pass their focused regressions while workflow behavior and decorator callsites remain unchanged. Transitional stored-key fallback, broad missing-secret skips, and authentication occurring after dependent fixture setup remain explicit follow-ups for the environment migration; this repair does not claim to solve federation provisioning or every hosted test failure. |
Related investigation: #104
Summary
Fix restricted BigQuery tests treating a stored service-account key as federated ADC and demanding impersonation targets. Credential selection now checks the actual JSON credential type: key-based tests retain their existing per-identity secret lookup, while federated/user ADC uses the configured restricted service account.
Scope credential environment changes and generated files to each decorated test. Temporary keys are removed and the original environment is restored after success, failure, skip, or setup failure, including async tests. Existing credential input files remain unchanged.
This first repair deliberately retains the stored-key fallback and current decorator setup timing. Removing the fallback and moving authentication before dependent fixtures belong to the subsequent environment migration. Workflow configuration and strict WIF enforcement are unchanged.
Change map
File-by-file change map.
Testing Done
flake8 -j 1,isort --check-only, andgit diff --check: passed.PYTHONPATH; this worktree has no.venv. Dependency warnings remain.Checklist
setup_bigquery_credentialsnow scopes setup through a context manager; its only in-tree consumers are the decorator and focused tests. Existing decorator callsites are unchanged.