-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(android): Load Android context in JS like on iOS (#3170)
This enables users to interact/modify the context in the `beforeSend` callback like on iOS and also ensures there are no modifications to the event after leaving the callback.
- Loading branch information
1 parent
94c1854
commit b0855ef
Showing
36 changed files
with
1,150 additions
and
154 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
with: | ||
access_token: ${{ github.token }} | ||
|
||
test: | ||
test-ios: | ||
name: ios | ||
runs-on: macos-latest | ||
steps: | ||
|
@@ -32,13 +32,13 @@ jobs: | |
run: yarn install | ||
|
||
- name: Install App Pods | ||
working-directory: RNSentryTester | ||
working-directory: RNSentryCocoaTester | ||
run: pod install | ||
|
||
- name: Run iOS Tests | ||
working-directory: RNSentryTester | ||
working-directory: RNSentryCocoaTester | ||
env: | ||
SCHEME: RNSentryTester | ||
SCHEME: RNSentryCocoaTester | ||
CONFIGURATION: Release | ||
DESTINATION: 'platform=iOS Simulator,OS=latest,name=iPhone 14' | ||
run: | | ||
|
@@ -47,3 +47,69 @@ jobs: | |
-scheme $SCHEME -configuration $CONFIGURATION \ | ||
-destination "$DESTINATION" \ | ||
test | ||
test-android: | ||
name: android | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v3 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-21 | ||
|
||
- name: Create AVD and generate snapshot for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected] | ||
with: | ||
api-level: 21 | ||
emulator-options: > | ||
-accel on | ||
-no-window | ||
-gpu swiftshader_indirect | ||
-noaudio | ||
-no-boot-anim | ||
-camera-back none | ||
-camera-front none | ||
-timezone US/Pacific | ||
force-avd-creation: false | ||
disable-animations: true | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Run connected tests | ||
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected] | ||
with: | ||
working-directory: RNSentryAndroidTester | ||
api-level: 21 | ||
emulator-options: > | ||
-no-snapshot-save | ||
-accel on | ||
-no-window | ||
-gpu swiftshader_indirect | ||
-noaudio | ||
-no-boot-anim | ||
-camera-back none | ||
-camera-front none | ||
-timezone US/Pacific | ||
force-avd-creation: false | ||
disable-animations: true | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: | | ||
./gradlew uninstallDebug uninstallDebugAndroidTest | ||
./gradlew connectedCheck |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
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 @@ | ||
/build |
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,49 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'org.jetbrains.kotlin.android' | ||
} | ||
|
||
android { | ||
namespace 'io.sentry.rnsentryandroidtester' | ||
compileSdk 33 | ||
|
||
defaultConfig { | ||
applicationId "io.sentry.rnsentryandroidtester" | ||
minSdk 21 | ||
targetSdk 33 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_11 | ||
targetCompatibility JavaVersion.VERSION_11 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '11' | ||
} | ||
|
||
testOptions.unitTests.all { | ||
testLogging { | ||
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(':RNSentry') | ||
implementation 'com.facebook.react:react-android:0.72.0' | ||
implementation 'androidx.core:core-ktx:1.7.0' | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.5.0' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
} |
Oops, something went wrong.