- Notifications
You must be signed in to change notification settings - Fork 1.7k
[Firebase AI] Upload xcodebuild logs in integration tests #14844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Using Gemini Code AssistThe 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either
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 Limitations & Feedback Gemini Code Assist is currently in preview and 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 to provide feedback. |
xcodebuild.log in integration testsxcodebuild logs in integration tests There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
Overall, the changes effectively address the need to capture raw xcodebuild logs for debugging integration tests, especially given the limitations of xcbeautify for certain test types. Splitting the build and test steps to get separate logs is a good approach for clarity. The use of NSUnbufferedIO=YES and piping stderr (2>&1) from xcodebuild ensures that the full, unbuffered output is captured by tee and passed to xcbeautify. This is a solid improvement for debugging test failures.
Summary of Findings
- Brittle build action detection: The script assumes the build action (
build,test, etc.) is always the last argument passed toRunXcodebuild. This could break if the argument order changes. - Redundant
2>&1in pipe: The2>&1aftertee "$log_filename"is unnecessary astee's standard output is already piped. - Split build and test steps: The
build testcommand was correctly split into separatebuildandtestcalls to generate distinct logs, as intended by the PR.
Merge Readiness
The changes implement the desired logging behavior and address the issue of xcbeautify filtering. The core logic for capturing logs seems correct. The main point of concern is the potentially brittle method of detecting the build action from the arguments. If the convention of the action always being the last argument is guaranteed within this script's usage, the changes are likely fine. However, if that convention is not strictly enforced, it could lead to incorrect log filenames. I recommend addressing this potential brittleness before merging. Please note that I am unable to directly approve the pull request; other reviewers should review and approve this code before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks
testapp-integrationjob of thefirebaseaiworkflow to upload the rawxcodebuildlog on failure to help with debugging.xcbeautifyfilters out a lot of the important details in parameterized Swift Testing-based tests.xcodebuild.logintobuildandtestlogs. The test log is a fraction of the size so it's easier to see the test failures when split.xcbeautifyguidance for piping the output https://github.com/cpisciotta/xcbeautify#usage.#no-changelog