From 9e92adba23069bc709a11a1373894b3a904d1c3f Mon Sep 17 00:00:00 2001 From: gs Date: Tue, 16 Dec 2025 08:28:40 -0800 Subject: [PATCH 1/2] fix npm packaging pipeline --- js/react_native/e2e/.detoxrc.js | 11 ++++ .../templates/react-native-ci.yml | 53 +++++++++++-------- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/js/react_native/e2e/.detoxrc.js b/js/react_native/e2e/.detoxrc.js index 873efcf0bf402..f286940f5af7d 100644 --- a/js/react_native/e2e/.detoxrc.js +++ b/js/react_native/e2e/.detoxrc.js @@ -42,6 +42,13 @@ module.exports = { os: 'iOS 17.4', }, }, + simulator_ios_18_6: { + type: 'ios.simulator', + device: { + type: 'iPhone 16', + os: 'iOS 18.6', + }, + }, attached: { type: 'android.attached', device: { @@ -64,6 +71,10 @@ module.exports = { device: 'simulator', app: 'ios.release', }, + 'ios.sim_18_6.release': { + device: 'simulator_ios_18_6', + app: 'ios.release', + }, 'android.att.debug': { device: 'attached', app: 'android.debug', diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 1a204e4cb6dae..97a8c8c155f3b 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -86,7 +86,7 @@ stages: python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \ --staging-dir "$(Build.BinariesDirectory)/ios_pod" \ - --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json + --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings_arm64.json displayName: Build iOS package and assemble pods - task: 1ES.PublishPipelineArtifact@1 @@ -122,31 +122,42 @@ stages: - template: ../stages/jobs/steps/react-native-bootstrap-steps.yml - script: | - ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios_pod/onnxruntime-c \ - pod install - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' + brew tap wix/brew + brew install applesimutils + displayName: Install applesimutils + + - script: | + gem install securerandom -v 0.3.2 --user-install --force + gem install drb -v 2.0.6 --user-install --force + gem install zeitwerk -v 2.6.18 --user-install --force + gem install activesupport -v 6.0.6.1 --user-install --force + gem install ffi -v 1.15.5 --user-install --force + gem install cocoapods -v 1.11.3 --user-install --force + displayName: Install CocoaPods + + - script: | + set -e -x + export PATH=$HOME/.gem/ruby/2.6.0/bin:$PATH + export LANG=en_US.UTF-8 + ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios_pod/onnxruntime-c pod install --verbose + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/ios' displayName: Pod install for onnxruntime react native ios bridge library - # Run unit tests on iOS simulator - - task: Xcode@5 - inputs: - actions: 'test' - configuration: 'Debug' - sdk: 'iphonesimulator' - xcWorkspacePath: '$(Build.SourcesDirectory)/js/react_native/ios/OnnxruntimeModule.xcworkspace' - scheme: 'OnnxruntimeModuleTest' - packageApp: false - destinationPlatformOption: 'iOS' - destinationSimulators: 'iPhone 15,OS=17.4' - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' - xcprettyArgs: '--output build/reports/test-results.xml' - publishJUnitResults: true - testRunTitle: 'React Native iOS Instrumented Test Results' - displayName: Run React Native iOS Instrumented Tests + - script: | + xcrun simctl list runtimes + xcrun simctl list devices + detox build --configuration ios.sim_18_6.release + JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ + detox test --record-logs all \ + --configuration ios.sim.release \ + --loglevel verbose \ + --take-screenshots failing + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Build and Run Detox iOS e2e Tests - task: PublishTestResults@2 inputs: - testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/ios/build/reports/test-results.xml' + testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml' failTaskOnFailedTests: true testRunTitle: 'React Native iOS Instrumented Test results' condition: succeededOrFailed() From 6cf824a068173c8028cc090fb2a7dad346cb8bea Mon Sep 17 00:00:00 2001 From: gs Date: Tue, 16 Dec 2025 09:36:57 -0800 Subject: [PATCH 2/2] use sim_18_6 for test too --- .../github/azure-pipelines/templates/react-native-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 97a8c8c155f3b..17f538c5f7ca3 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -149,7 +149,7 @@ stages: detox build --configuration ios.sim_18_6.release JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ detox test --record-logs all \ - --configuration ios.sim.release \ + --configuration ios.sim_18_6.release \ --loglevel verbose \ --take-screenshots failing workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e'