fix: mock list_validations in config_runner tests to remove GCS dependency#1708
Merged
nj1973 merged 1 commit intoGoogleCloudPlatform:developfrom Apr 1, 2026
Merged
Conversation
…dency Tests test_config_runner_2 and test_config_runner_4 were accessing real GCS buckets (gs://pso-kokoro-resources) via cli_tools.list_validations, causing failures for external contributors without GCS credentials. This change: - Mocks cli_tools.list_validations to return expected YAML file lists - Replaces GCS paths in test config with local paths Fixes GoogleCloudPlatform#1482
nj1973
approved these changes
Apr 1, 2026
Collaborator
nj1973
left a comment
There was a problem hiding this comment.
Thanks for the contribution @yasumorishima , this LGTM.
Collaborator
|
/gcbrun |
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.
Summary
cli_tools.list_validationsintest_config_runner_2andtest_config_runner_4to remove dependency on real GCS buckets (gs://pso-kokoro-resources)Issue
Fixes #1482
Root Cause
config_runner()callscli_tools.list_validations(config_dir=args.config_dir)which reachesgcs_helper.list_gcs_directory()when the path starts withgs://. External contributors without GCS credentials getDefaultCredentialsError.Changes
test_config_runner_2: Added@mock.patch("data_validation.cli_tools.list_validations")returning 3 YAML filenamestest_config_runner_4: Added@mock.patch("data_validation.cli_tools.list_validations")returning 4 YAML filenamesCONFIG_RUNNER_ARGS_2/CONFIG_RUNNER_ARGS_4: Changedconfig_dirfromgs://pso-kokoro-resources/...to/tmp/test/...Testing
Full unit test suite: 375 passed, 2 failed (pre-existing GCP auth failures unrelated to this change), 10 skipped.