-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mobile] Add E2E BrowserStack tests for iOS tests (#22610)
### Description - Changes running the E2E iOS tests from running in App Center to running in BrowserStack - Steps for running locally can be found in the OneNote ### Motivation and Context - Follow-up of #22117 - App Center (the previous platform for running E2E mobile tests) is getting deprecated in 2025 ### Misc info Additional build steps were required to get the necessary testing artifacts for BrowserStack. App Center consumed an entire folder, while BrowserStack requests the following: 1. a ZIP file of all the tests 2. an IPA file of the test app #### Flow Here is a rough outline of what is happening in the pipeline: 1. The build_and_assemble_apple_pods.py script builds the relevant frameworks (currently, this means packages for iOS and Mac) 4. The test_apple_packages.py script installs the necessary cocoapods for later steps 5. XCode task to build for testing builds the iOS target for the test app 6. Now that the test app and the tests have been built, we can zip them, creating the tests .zip file 7. To create the IPA file, we need to create a .plist XML file which is generated by the generate_plist.py script. - Attempts to use the Xcode@5 task to automatically generate the plist file failed. - Also, building for testing generates some plist files -- these cannot be used to export an IPA file. 8. We run the Xcode task to build an .xcarchive file, which is required for creating an IPA file. 9. We use xcodebuild in a script step to build an IPA file with the xcarchive and plist files from the last two steps. 10. Finally, we can run the tests using the BrowserStack script. --------- Co-authored-by: Scott McKay <[email protected]> Co-authored-by: Edward Chen <[email protected]>
- Loading branch information
Showing
5 changed files
with
129 additions
and
34 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
onnxruntime/test/platform/apple/generate_ipa_export_options_plist.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import argparse | ||
|
||
plist_file_content = """ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>method</key> | ||
<string>development</string> | ||
<key>teamID</key> | ||
<string>{team_id}</string> | ||
<key>provisioningProfiles</key> | ||
<dict> | ||
<key>ai.onnxruntime.tests.ios-package-test</key> | ||
<string>{provisioning_profile_uuid}</string> | ||
</dict> | ||
<key>signingStyle</key> | ||
<string>manual</string> | ||
</dict> | ||
</plist> | ||
""" | ||
if __name__ == "__main__": | ||
# handle cli args | ||
parser = argparse.ArgumentParser( | ||
"Generates a PList file to the relevant destination. This PList file contains the properties to allow a user to generate an IPA file for the ios-package-test. " | ||
) | ||
|
||
parser.add_argument("--dest_file", type=str, help="Path to output the PList file to.", required=True) | ||
parser.add_argument( | ||
"--apple_team_id", | ||
type=str, | ||
help="The Team ID associated with the provisioning profile. You should be able to find this from the Apple developer portal under Membership.", | ||
required=True, | ||
) | ||
parser.add_argument( | ||
"--provisioning_profile_uuid", | ||
type=str, | ||
help="The Provisioning Profile UUID, which can be found in the .mobileprovision file. ", | ||
required=True, | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
formatted_plist = plist_file_content.format( | ||
team_id=args.apple_team_id, provisioning_profile_uuid=args.provisioning_profile_uuid | ||
) | ||
|
||
with open(args.dest_file, "w") as file: | ||
file.write(formatted_plist) | ||
|
||
print("Wrote plist file to ", args.dest_file) | ||
print() | ||
print("Contents of file:") | ||
print(formatted_plist) |
This file contains 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
12 changes: 0 additions & 12 deletions
12
tools/ci_build/github/azure-pipelines/templates/install-appcenter.yml
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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