infra(all): Introduce generic script for integration tests #15415
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.
Per b/450976183,
This adds a generic command for SDK teams to decrypt their secret files for integration tests. Note that I also (locally) have subcommands for
encryptandrun, but have not included those in this PR to keep the diff small.More broadly, this PR introduces a new swift package called
repowhich is intended to be a point of migration for our larger bash scripts that are harder to maintain in bash form. Currently, it only includes theteststarget for integration tests, but it's intended to be expanded upon as we deem necessary. The main point of this PR is to discuss whether we find this valuable or not. I felt it would be easier to integrate the generic commands for testing if I could take advantage ofArgumentParser, which led me to the idea of centralizing our larger bash scripts here. @ncooke3 greenlit the idea, but also felt it would be worth having further discussion in the PR.As far as the specifics on
decrypt, I have expanded it from #15398 to be more generic. You can now call it inline with generic parameters specifying the secret files and passphrase, or use a predefined JSON file to specify the secrets, and defer to an environment variable for the passphrase. You can also toggle the overwrite behavior (whether to leave existing decrypted files alone, or overwrite them).Example usage of doing everything inline:
./scripts/repo tests decrypt --password "super_secret" \ scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info.plist.gpg:FirebaseAI/Tests/TestApp/Resources/GoogleService-Info.plist \ scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info-Spark.plist.gpg:FirebaseAI/Tests/TestApp/Resources/GoogleService-Info-Spark.plistExample usage of using a JSON file and an environment variable for the passphrase:
#no-changelog