Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
00e9040
ref(ios): Extract Cocoa SDK init into standalone file (#4442)
krystofwoldrich Jan 21, 2025
4c0b8f4
Merge branch 'main' into capture-app-start-errors
krystofwoldrich Jan 21, 2025
2cb7eb2
ref(android): Extracts Android native initialization to standalone stโ€ฆ
antonis Jan 22, 2025
7144a64
feat(experimental): Add native `startWithConfigureOptions` for Apple โ€ฆ
krystofwoldrich Jan 22, 2025
7850677
feat: Read `sentry.options.json` during cocoa init (#4447)
krystofwoldrich Jan 22, 2025
1e5dbde
Adds utility class for converting `JsonObject` to `WritableMap` (#4479)
antonis Jan 23, 2025
22a5f81
feat: Automatically load `sentry.options.json` file (#4476)
krystofwoldrich Feb 3, 2025
a1cb36d
feat(experimental): Initialize Android SDK from json configuration (#โ€ฆ
antonis Feb 4, 2025
95c36ef
Merge branch 'main' into capture-app-start-errors
krystofwoldrich Feb 5, 2025
14fe05d
misc: Add `sentry.options.json` example to the changelog (#4509)
krystofwoldrich Feb 5, 2025
15a7e6d
feat(init): Load options from `sentry.options.json` in JS (#4510)
krystofwoldrich Feb 6, 2025
b9ec093
release: 6.7.0-alpha.0
getsentry-bot Feb 6, 2025
dbdd4b5
Merge branch 'release/6.7.0-alpha.0' into capture-app-start-errors
Feb 6, 2025
b947d7f
misc(sample): Change RN Sample to use native file init by default (#4โ€ฆ
krystofwoldrich Feb 13, 2025
6b08b9a
chore(sample-rn): Remove duplicate init options from code (#4532)
krystofwoldrich Feb 13, 2025
a7ffa1f
chore(sample-rn): Always use fhe file option (including auto init) (#โ€ฆ
krystofwoldrich Feb 13, 2025
28cf7b4
internal(sample-rn): Add Detox for integration/e2e tests of the rn saโ€ฆ
krystofwoldrich Feb 14, 2025
cf00d4d
internal(sample-rn): Add header and message envelope tests (#4536)
krystofwoldrich Feb 17, 2025
b754aa3
Merge remote-tracking branch 'origin/main' into capture-app-start-errors
krystofwoldrich Feb 18, 2025
0bf6636
fix(sample-e2e): Fix type errors missing sentry/core and afterAll (#4โ€ฆ
krystofwoldrich Feb 20, 2025
0f5cd7d
Merge remote-tracking branch 'origin/main' into capture-app-start-errors
krystofwoldrich Feb 20, 2025
e935360
chore(samples): Add package scripts for native builds, dsn and testinโ€ฆ
krystofwoldrich Feb 21, 2025
952dd05
Merge branch 'main' into capture-app-start-errors
krystofwoldrich Feb 24, 2025
ae342a3
test(e2e): Verify captured Errors Screen transaction (#4584)
krystofwoldrich Feb 25, 2025
770f9fb
test(e2e): Add auto init from JS tests (#4588)
krystofwoldrich Feb 25, 2025
cbb85b2
test(e2e): Add app start crash test for iOS (#4593)
krystofwoldrich Feb 25, 2025
b4ee16b
test(e2e): Avoid race conditions when waiting for captured message (#โ€ฆ
krystofwoldrich Feb 26, 2025
ee11f58
chore(sample-e2e): Move Detox related files to e2e-detox dir
krystofwoldrich Jun 11, 2025
588ba6d
Merge branch 'main' into capture-app-start-errors
krystofwoldrich Jun 11, 2025
cc98f49
Merge main (v7) into capture-app-start-errors-v7
antonis Dec 15, 2025
1e01928
fix: remove unused SentryPackage import
antonis Dec 15, 2025
50ff76a
fix: update RNSentryStartTest for Sentry Android SDK v7 API changes
antonis Dec 15, 2025
0efb3bf
fix: remove unused addPackages method to fix PMD lint error
antonis Dec 15, 2025
013f560
fix: update RNSentrySDKTest for Sentry Android SDK v7 API changes
antonis Dec 15, 2025
d93c1b9
fix: use relative path for RNSentrySDK+Test.h import in bridging header
antonis Dec 15, 2025
b25688f
fix: remove deprecated enableTracing property in iOS RNSentryStart
antonis Dec 15, 2025
86d2829
fix: remove enableTracing assertions from iOS tests
antonis Dec 15, 2025
d0f1987
Update Podspec
antonis Dec 15, 2025
032f74a
Fix lint issue
antonis Dec 15, 2025
23c6824
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 16, 2025
37325ad
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 16, 2025
232bf39
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 17, 2025
f1e4ec4
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 18, 2025
db91022
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 19, 2025
84390fb
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 22, 2025
33d1129
ref(sample-e2e): v7: Migrate from Detox to Maestro (#5473)
antonis Dec 22, 2025
410ff43
Merge branch 'main' into capture-app-start-errors-v7
antonis Dec 23, 2025
1e2baca
Merge branch 'main' into capture-app-start-errors-v7
antonis Jan 12, 2026
093a889
Merge branch 'main' into capture-app-start-errors-v7
antonis Jan 15, 2026
fe4edc7
chore: Merge Android UI profiling on the capture startup crashes branโ€ฆ
antonis Jan 16, 2026
3662a66
Merge branch 'main' into capture-app-start-errors-v7
antonis Jan 16, 2026
7c7a53e
Merge branch 'main' into capture-app-start-errors-v7
antonis Jan 20, 2026
ad19701
fix SR iOS issue (#5560)
antonis Jan 21, 2026
72546e6
Remove duplicate changelog entry
antonis Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
internal(sample-rn): Add Detox for integration/e2e tests of the rn saโ€ฆ
โ€ฆmple (#4535)
  • Loading branch information
krystofwoldrich authored Feb 14, 2025
commit 28cf7b4377cfbb4510be19086ecad3958a2bbbc8
172 changes: 167 additions & 5 deletions .github/workflows/sample-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ concurrency:
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RN_SENTRY_POD_NAME: RNSentry
IOS_APP_ARCHIVE_PATH: sentry-react-native-sample.app.zip
ANDROID_APP_ARCHIVE_PATH: sentry-react-native-sample.apk.zip
REACT_NATIVE_SAMPLE_PATH: samples/react-native
IOS_DEVICE: 'iPhone 16'
IOS_VERSION: '18.1'
ANDROID_API_LEVEL: '30'

jobs:
diff_check:
Expand Down Expand Up @@ -66,7 +72,7 @@ jobs:
- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
with:
working-directory: ${{ matrix.platform == 'ios' && ' samples/react-native' || ' samples/react-native-macos' }}
working-directory: ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || ' samples/react-native-macos' }}
ruby-version: '3.3.0' # based on what is used in the sample
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # cache the installed gems
Expand Down Expand Up @@ -106,7 +112,7 @@ jobs:

- name: Build Android App
if: ${{ matrix.platform == 'android' }}
working-directory: samples/react-native/android
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
run: |
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
Expand All @@ -119,11 +125,14 @@ jobs:
fi
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
[[ "${{ matrix.build-type }}" == "production" ]] && TEST_TYPE='release' || TEST_TYPE='debug'
echo "Building $TEST_TYPE"

./gradlew ":app:assemble$CONFIG" app:assembleAndroidTest -DtestBuildType=$TEST_TYPE -PreactNativeArchitectures=x86

- name: Build iOS App
if: ${{ matrix.platform == 'ios' }}
working-directory: samples/react-native/ios
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
Expand Down Expand Up @@ -160,9 +169,162 @@ jobs:
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output

- name: Archive iOS App
if: ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
run: |
cd ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/DerivedData/Build/Products/Release-iphonesimulator
zip -r \
${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \
sentryreactnativesample.app

- name: Archive Android App
if: ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
run: |
mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/release/app-release.apk app.apk
mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk app-androidTest.apk
zip -j \
${{ env.ANDROID_APP_ARCHIVE_PATH }} \
app.apk \
app-androidTest.apk

- name: Upload iOS APP
if: ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
uses: actions/upload-artifact@v4
with:
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }}
path: ${{ env.IOS_APP_ARCHIVE_PATH }}
retention-days: 1

- name: Upload Android APK
if: ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
uses: actions/upload-artifact@v4
with:
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }}
path: ${{ env.ANDROID_APP_ARCHIVE_PATH }}
retention-days: 1

- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
path: samples/react-native/${{ matrix.platform }}/*.log
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/${{ matrix.platform }}/*.log

test:
name: Test ${{ matrix.platform }} ${{ matrix.build-type }}
runs-on: ${{ matrix.runs-on }}
needs: [diff_check, build]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
include:
- platform: ios
runs-on: macos-15
rn-architecture: 'new'
ios-use-frameworks: 'no-frameworks'
build-type: 'production'

- platform: android
runs-on: ubuntu-latest
rn-architecture: 'new'
build-type: 'production'

steps:
- uses: actions/checkout@v4

- name: Download iOS App Archive
if: ${{ matrix.platform == 'ios' }}
uses: actions/download-artifact@v4
with:
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }}
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}

- name: Download Android APK
if: ${{ matrix.platform == 'android' }}
uses: actions/download-artifact@v4
with:
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }}
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}

- name: Unzip iOS App Archive
if: ${{ matrix.platform == 'ios' }}
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
run: unzip ${{ env.IOS_APP_ARCHIVE_PATH }}

- name: Unzip Android APK
if: ${{ matrix.platform == 'android' }}
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
run: unzip ${{ env.ANDROID_APP_ARCHIVE_PATH }}

- name: Enable Corepack
run: |
npm install -g [email protected]
corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: yarn.lock

- name: Install JS Dependencies
run: yarn install

- name: Install Detox
run: npm install -g [email protected]

- name: Install Apple Simulator Utilities
if: ${{ matrix.platform == 'ios' }}
run: |
brew tap wix/brew
brew install applesimutils

- name: Setup KVM
if: ${{ matrix.platform == 'android' }}
shell: bash
run: |
# check if virtualization is supported...
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
# allow access to KVM to run the emulator
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- uses: futureware-tech/simulator-action@dab10d813144ef59b48d401cd95da151222ef8cd # pin@v4
if: ${{ matrix.platform == 'ios' }}
with:
# the same envs are used by Detox ci.sim configuration
model: ${{ env.IOS_DEVICE }}
os_version: ${{ env.IOS_VERSION }}

- name: Run Detox iOS Tests
if: ${{ matrix.platform == 'ios' }}
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
run: detox test --configuration ci.sim

- name: Run tests on Android
if: ${{ matrix.platform == 'android' }}
env:
# used by Detox ci.android configuration
ANDROID_AVD_NAME: 'test' # test is default reactivecircus/android-emulator-runner name
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected]
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
force-avd-creation: false
disable-animations: true
disable-spellchecker: true
target: 'aosp_atd'
channel: canary # Necessary for ATDs
emulator-options: >
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
script: detox test --configuration ci.android
119 changes: 119 additions & 0 deletions samples/react-native/.detoxrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
const process = require('process');

/** @type {Detox.DetoxConfig} */
module.exports = {
testRunner: {
args: {
$0: 'jest',
config: 'e2e/jest.config.js',
},
jest: {
setupTimeout: 120000,
},
},
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath:
'ios/build/Build/Products/Debug-iphonesimulator/sentryreactnativesample.app',
build:
'xcodebuild -workspace ios/sentryreactnativesample.xcworkspace -scheme sentryreactnativesample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
},
'ios.release': {
type: 'ios.app',
binaryPath:
'ios/build/Build/Products/Release-iphonesimulator/sentryreactnativesample.app',
build:
'xcodebuild -workspace ios/sentryreactnativesample.xcworkspace -scheme sentryreactnativesample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build:
'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug',
reversePorts: [8081],
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build:
'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release',
},
'ci.android': {
type: 'android.apk',
binaryPath: 'app.apk',
testBinaryPath: 'app-androidTest.apk',
},
'ci.ios': {
type: 'ios.app',
binaryPath: 'sentryreactnativesample.app',
},
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 16',
},
},
attached: {
type: 'android.attached',
device: {
adbName: '.*',
},
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Pixel_9_API_35',
},
},
'ci.emulator': {
type: 'android.emulator',
device: {
avdName: process.env.ANDROID_AVD_NAME,
},
},
'ci.simulator': {
type: 'ios.simulator',
device: {
type: process.env.IOS_DEVICE,
os: process.env.IOS_VERSION,
},
},
},
configurations: {
'ios.sim.debug': {
device: 'simulator',
app: 'ios.debug',
},
'ios.sim.release': {
device: 'simulator',
app: 'ios.release',
},
'android.att.debug': {
device: 'attached',
app: 'android.debug',
},
'android.att.release': {
device: 'attached',
app: 'android.release',
},
'android.emu.debug': {
device: 'emulator',
app: 'android.debug',
},
'android.emu.release': {
device: 'emulator',
app: 'android.release',
},
'ci.android': {
device: 'ci.emulator',
app: 'ci.android',
},
'ci.sim': {
device: 'ci.simulator',
app: 'ci.ios',
},
},
};
8 changes: 8 additions & 0 deletions samples/react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ android {
versionCode 39
versionName "6.7.0-alpha.0"
buildConfigField "boolean", "SENTRY_DISABLE_NATIVE_START", System.getenv('SENTRY_DISABLE_NATIVE_START') ?: String.valueOf(sentryDisableNativeStart)

// Detox
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

signingConfigs {
Expand Down Expand Up @@ -193,11 +197,15 @@ android {
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
}
}
}

dependencies {
androidTestImplementation('com.wix:detox:+')
implementation 'androidx.appcompat:appcompat:1.7.0'

// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

Expand Down
4 changes: 4 additions & 0 deletions samples/react-native/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# Detox Release tests were failing on missing kotlin.Result
# It should be covered by node_modules/detox/android/detox/proguard-rules-app.pro but it seems missing
-keep class kotlin.** { *; }
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.sentry.reactnative.sample;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
@LargeTest
public class DetoxTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule =
new ActivityTestRule<>(MainActivity.class, false, false);

@Test
public void runDetoxTests() {
DetoxConfig detoxConfig = new DetoxConfig();
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);

Detox.runTests(mActivityRule, detoxConfig);
}
}
Loading