Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SentrySerialized to ReactNativeWritable convertor, load device context from sentry-java scope #3170

Merged
merged 35 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5b6a0f9
Add SentrySerialized to ReactNativeWritable convertor, load device co…
krystofwoldrich Jul 10, 2023
0baa9de
Update changelog
krystofwoldrich Jul 10, 2023
a867f8a
Add RNSentryAndroidTester project to test the RNSentry Android module
krystofwoldrich Jul 10, 2023
f1d91dc
Add android CI tests
krystofwoldrich Jul 10, 2023
0a163ea
Add android tests to CI, add basic key value converter tests
krystofwoldrich Jul 10, 2023
da1b6a8
Fix emulator working dir
krystofwoldrich Jul 10, 2023
5ed7083
Add tests
krystofwoldrich Jul 10, 2023
a864fff
Update devicecontext to use both context and contexts fields
krystofwoldrich Jul 11, 2023
35e8aba
tmp: comment out internal to test android tester ci
krystofwoldrich Jul 13, 2023
65211d0
Update converter for long and other big numbers
krystofwoldrich Jul 13, 2023
74b5094
Fix JS tests JS keeps breadcrumbs on android
krystofwoldrich Jul 13, 2023
48b73f8
Update changelog
krystofwoldrich Jul 13, 2023
cc655e3
Revert "tmp: comment out internal to test android tester ci"
krystofwoldrich Jul 13, 2023
9d59cb3
Restore getscope and captureenvelope, lint imports
krystofwoldrich Jul 13, 2023
ccf9a79
Merge remote-tracking branch 'origin/main' into kw-android-new-event-…
krystofwoldrich Jul 18, 2023
f24552e
Use backticks for tests names
krystofwoldrich Jul 18, 2023
3bb450a
Update cocoa tester name
krystofwoldrich Jul 18, 2023
62c3a72
Add null checks
krystofwoldrich Jul 18, 2023
17cd520
fix changelog
krystofwoldrich Jul 18, 2023
f63f2bf
Fix annotations
krystofwoldrich Jul 19, 2023
c8564c6
Update Android SDK, fix ts types
krystofwoldrich Jul 19, 2023
583b86c
Rename cocoa context to contexts to unify the naming
krystofwoldrich Jul 19, 2023
a8a0713
Add android sdk info
krystofwoldrich Jul 19, 2023
0058ec1
Fix node version for e2e tests
krystofwoldrich Jul 19, 2023
011bbe4
Fix node for newer rn versions
krystofwoldrich Jul 19, 2023
cf51653
Fix cocoa tester scheme name
krystofwoldrich Jul 19, 2023
113b6f7
Revert "Use backticks for tests names"
krystofwoldrich Jul 19, 2023
01a4c6f
convert test names to camel case
krystofwoldrich Jul 19, 2023
60f0620
Remove unit tests, we don't have any at the moment
krystofwoldrich Jul 19, 2023
8cc59fa
Merge remote-tracking branch 'origin/main' into kw-android-new-event-…
krystofwoldrich Jul 25, 2023
0b1e855
Add clean emulator step to native android tests
krystofwoldrich Jul 26, 2023
b29c3bb
Run clean emulator with emulator running
krystofwoldrich Jul 26, 2023
48d2ba9
Bump Android SDK to 6.27.0
krystofwoldrich Jul 26, 2023
e29f4dc
Merge remote-tracking branch 'origin/HEAD' into kw-android-new-event-…
krystofwoldrich Jul 26, 2023
fdb07b3
Update changelog
krystofwoldrich Jul 26, 2023
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
20 changes: 20 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ jobs:
echo "SENTRY_RELEASE=$SENTRY_RELEASE"
echo "SENTRY_DIST=$SENTRY_DIST"

- uses: actions/setup-node@v3
if: ${{ matrix.rn-version == '0.65.3' }}
with:
node-version: 16

- uses: actions/setup-node@v3
if: ${{ matrix.rn-version != '0.65.3' }}
with:
node-version: 18

- uses: actions/setup-java@v3
with:
java-version: '11'
Expand Down Expand Up @@ -376,6 +386,16 @@ jobs:
working-directory: test/e2e
run: tar -xvf *.tar

- uses: actions/setup-node@v3
if: ${{ matrix.rn-version == '0.65.3' }}
with:
node-version: 16

- uses: actions/setup-node@v3
if: ${{ matrix.rn-version != '0.65.3' }}
with:
node-version: 18

- uses: actions/setup-java@v3
with:
java-version: '11'
Expand Down
74 changes: 70 additions & 4 deletions .github/workflows/native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
access_token: ${{ github.token }}

test:
test-ios:
name: ios
runs-on: macos-latest
steps:
Expand All @@ -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: |
Expand All @@ -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
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved

- 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Warn users about multiple versions of `promise` package which can cause unexpected behavior like undefined `Promise.allSettled` ([#3162](https:/getsentry/sentry-react-native/pull/3162))
- Event is enriched with all the Android context on the JS layer and you can filter/modify all the data in the `beforeSend` callback similarly to iOS. ([#3170](https:/getsentry/sentry-react-native/pull/3170))

### Dependencies

Expand All @@ -14,6 +15,9 @@
- Bump Cocoa SDK from v8.8.0 to v8.9.3 ([#3188](https:/getsentry/sentry-react-native/pull/3188), [#3206](https:/getsentry/sentry-react-native/pull/3206))
- [changelog](https:/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#893)
- [diff](https:/getsentry/sentry-cocoa/compare/8.8.0...8.9.3)
- Bump Android SDK from v6.25.1 to v6.27.0 ([#3170](https:/getsentry/sentry-react-native/pull/3170))
- [changelog](https:/getsentry/sentry-java/blob/main/CHANGELOG.md#6270)
- [diff](https:/getsentry/sentry-java/compare/6.25.1...6.27.0)

## 5.7.1

Expand Down
15 changes: 15 additions & 0 deletions RNSentryAndroidTester/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
.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
1 change: 1 addition & 0 deletions RNSentryAndroidTester/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
49 changes: 49 additions & 0 deletions RNSentryAndroidTester/app/build.gradle
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'
}
Loading
Loading