Add support for patching DYLD_FRAMEWORK_PATH in xctestrun for Xcode 26+#3006
Add support for patching DYLD_FRAMEWORK_PATH in xctestrun for Xcode 26+#3006
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the iOS test backend to ensure proper test execution on simulators with Xcode 26 and later versions. It resolves an issue where Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 by creating a comment 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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new private method, _patchXcTestRunDyldPath, to IOSTestBackend. This method addresses an issue in Xcode 26+ by appending the _Testing_Foundation.framework path to the DYLD_FRAMEWORK_PATH within xctestrun plist files when running tests on a simulator. The new patching logic is invoked after a successful build. A review comment highlights a potential silent failure: the PlistBuddy command used to set the DYLD_FRAMEWORK_PATH does not check its exit code, suggesting that error handling should be added to ensure the patching operation's success is verified.
| await _processManager.run( | ||
| [ | ||
| '/usr/libexec/PlistBuddy', | ||
| '-c', | ||
| 'Set $key $current:$addition', | ||
| plist, | ||
| ], | ||
| ); | ||
| _logger.detail('Patched xctestrun DYLD_FRAMEWORK_PATH for Xcode 26+'); | ||
| return; |
There was a problem hiding this comment.
The PlistBuddy command for setting the DYLD_FRAMEWORK_PATH does not check its exit code. If the Set operation fails, the issue might go unnoticed, leading to silent failures in the patching process. It's important to verify the success of this critical operation.
Consider checking the exitCode of the _processManager.run call for the Set command and logging an error or throwing an exception if it's not successful.
final setResult = await _processManager.run(
[
'/usr/libexec/PlistBuddy',
'-c',
'Set $key $current:$addition',
plist,
],
);
if (setResult.exitCode != 0) {
_logger.warn('Failed to patch xctestrun DYLD_FRAMEWORK_PATH for key "$key": ${setResult.stdErr.trim()}');
// Optionally, throw an exception here if a failed patch is critical
// throwToolExit('Failed to patch xctestrun DYLD_FRAMEWORK_PATH');
} else {
_logger.detail('Patched xctestrun DYLD_FRAMEWORK_PATH for Xcode 26+');
}
return;There was a problem hiding this comment.
I think that this is done on purpose, to not crash the process if this workaround will not work 🤔
…ed Xcode runtime artifacts for improved compatibility with Xcode 26+
Fix ios simulator and physical devices on xcode 26.4