diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 48c2ec055c..8f9a3ad623 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -413,6 +413,12 @@ jobs: - name: Run tests on iOS if: ${{ matrix.platform == 'ios' }} run: ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --test + + - name: Copy Sentry logs + if: ${{ always() }} + run: | + mkdir -p ./dev-packages/e2e-tests/maestro-logs + cp $(find ~/Library/Developer/CoreSimulator -name "sentry.log" | head -n 1) ./dev-packages/e2e-tests/maestro-logs/ || true - name: Upload logs if: ${{ always() }} diff --git a/dev-packages/e2e-tests/cli.mjs b/dev-packages/e2e-tests/cli.mjs index cb910ef938..a4ee63a849 100755 --- a/dev-packages/e2e-tests/cli.mjs +++ b/dev-packages/e2e-tests/cli.mjs @@ -143,6 +143,20 @@ if (actions.includes('create')) { env: env, }); + // Add this new step to modify the Podfile to use specific commit + console.log('Patching Podfile to use specific Sentry commit...'); + const podfilePath = `${appDir}/ios/Podfile`; + let podfileContent = fs.readFileSync(podfilePath, 'utf8'); + + // Add this line at the beginning of the target block + podfileContent = podfileContent.replace( + /target .* do/, + `$&\n pod 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '97c634a07762db3be14c989e5137b0736a1479cb'` + ); + + fs.writeFileSync(podfilePath, podfileContent); + console.log('Podfile patched successfully'); + if (fs.existsSync(`${appDir}/Gemfile`)) { execSync(`bundle install`, { stdio: 'inherit', cwd: appDir, env: env }); execSync('bundle exec pod install --repo-update', { stdio: 'inherit', cwd: `${appDir}/ios`, env: env }); diff --git a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js index 48660f1a56..5618cd755a 100755 --- a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js +++ b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js @@ -33,6 +33,8 @@ Sentry.init({ integrations: [ Sentry.mobileReplayIntegration(), ], + replaysSessionSampleRate: 1.0, + replaysOnErrorSampleRate: 1.0, }); `; const e2eComponentPatch = ''; diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 715b60bd8f..0b73ba9f7d 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.51.0' + s.dependency 'Sentry/HybridSDK' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) diff --git a/packages/core/RNSentryCocoaTester/Podfile b/packages/core/RNSentryCocoaTester/Podfile index 547f4d4310..77a6a2165c 100644 --- a/packages/core/RNSentryCocoaTester/Podfile +++ b/packages/core/RNSentryCocoaTester/Podfile @@ -9,6 +9,8 @@ target 'RNSentryCocoaTesterTests' do pod 'RNSentry', :path => '../RNSentry.podspec' pod 'OCMock', '3.9.1' + pod 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '97c634a07762db3be14c989e5137b0736a1479cb' + post_install do |installer| set_react_native_path(installer) end diff --git a/samples/react-native/ios/Podfile b/samples/react-native/ios/Podfile index 43ff907e4e..7275b7e95c 100644 --- a/samples/react-native/ios/Podfile +++ b/samples/react-native/ios/Podfile @@ -37,6 +37,8 @@ target 'sentryreactnativesample' do pod 'AppTurboModules', :path => "./../tm" end + pod 'Sentry/HybridSDK', :git => 'https://github.com/getsentry/sentry-cocoa.git', :commit => '97c634a07762db3be14c989e5137b0736a1479cb' + target 'sentryreactnativesampleTests' do inherit! :complete # Pods for testing