Skip to content

Conversation

daymxn
Copy link
Member

@daymxn daymxn commented Oct 9, 2025

This PR adds a script (scripts/tests/ai/run.sh) which can be used locally to run the integration tests for Firebase AI.

The script does the following:

  • Decrypts the secret files
  • Runs the integration tests
  • Deletes the decrypted secret files, regardless of the result of the tests
  • Propagates any error from the integration tests back up

You can explicitly provide an Xcode version and a platform target to the script, or let it automatically determine the arguments to use.

The script includes documentation, proper error handling, and debug logging.

#no-changelog

@daymxn daymxn requested a review from andrewheard October 9, 2025 19:19
@daymxn daymxn self-assigned this Oct 9, 2025
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@daymxn
Copy link
Member Author

daymxn commented Oct 9, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR introduces two new shell scripts for running AI integration tests locally. The scripts are well-structured and documented. I've found a few areas for improvement regarding script robustness and best practices, such as adding set -e where appropriate, checking exit codes, and quoting variables to handle potential edge cases with file paths. These changes will make the scripts more reliable and prevent confusing failures.

Copy link
Contributor

@andrewheard andrewheard left a comment

Choose a reason for hiding this comment

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

@ncooke3 Do we have a particular directory structure we should adhere to for the scripts directory? I'm wondering if we should do scripts/firebaseai and also move https://github.com/firebase/firebase-ios-sdk/blob/dcba4944aa9650110f636cfc00adabc21139b045/scripts/update_vertexai_responses.sh into there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would personally find the decrypt_secrets.sh script most useful locally since it automates most of the project setup. I'm not certain that I would personally use run.sh since I typically need to edit, run, edit, etc., in Xcode when working on the integration tests locally.

My only concern with checking in the script is that it could easily get out of date unless it's part of our CI job for running the integration tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I would personally find the decrypt_secrets.sh script most useful locally since it automates most of the project setup. I'm not certain that I would personally use run.sh since I typically need to edit, run, edit, etc., in Xcode when working on the integration tests locally.

I agree. run.sh is more-so useful if you just wanna test run integrations tests locally before waiting on CI to provision a mac (or creating a PR in general). If you're iterating on the integration tests themselves, then opening the project in XCode would be more straightforward.

My only concern with checking in the script is that it could easily get out of date unless it's part of our CI job for running the integration tests.

I've updated the PR to have the CI job use it as well, I just wasn't sure if that's what we wanted to do. But that sound s like a good idea to ensure it stays up-to-date.

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

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

This is a nice step forward for usability. Thanks!

A future project could be to generalize this for all products - with each product providing a list of encrypted files to the script.

Then to address Andrew's point, the same core script should be used by both CI and the local run script.

@daymxn
Copy link
Member Author

daymxn commented Oct 10, 2025

@ncooke3 Do we have a particular directory structure we should adhere to for the scripts directory? I'm wondering if we should do scripts/firebaseai and also move https://github.com/firebase/firebase-ios-sdk/blob/dcba4944aa9650110f636cfc00adabc21139b045/scripts/update_vertexai_responses.sh into there.

I like that Idea. Should I go ahead and do that, or would we want that in a follow up PR?

@daymxn daymxn requested a review from andrewheard October 10, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants