Skip to content

Commit

Permalink
Merge branch 'main' into kw/test/check-crash-envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Oct 29, 2024
2 parents e015905 + 5183da9 commit 2ee6559
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
gradle-home-cache-cleanup: true

- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # pin@v2
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
with:
languages: ${{ matrix.language }}

Expand All @@ -55,4 +55,4 @@ jobs:
./gradlew buildForCodeQL
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # pin@v2
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-ui-critical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
version: ${{env.MAESTRO_VERSION}}

- name: Run tests
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32.0
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2.33.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
Expand Down
4 changes: 2 additions & 2 deletions .sauce/sentry-uitest-android-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ suites:
useTestOrchestrator: true
devices:
- id: Samsung_Galaxy_S10_Plus_11_real_us # Samsung Galaxy S10+ - api 30 (11) - high end
- id: Samsung_Galaxy_A71_5G_real_us # Samsung Galaxy A71 5G - api 30 (11) - mid end
- id: Google_Pixel_4a_real_us # Google Pixel 4a - api 30 (11) - mid end
- id: Google_Pixel_3a_real # Google Pixel 3a - api 30 (11) - low end

- name: "Android 10 (api 29)"
Expand All @@ -42,7 +42,7 @@ suites:
useTestOrchestrator: true
devices:
- id: Google_Pixel_3a_XL_real # Google Pixel 3a XL - api 29 (10)
- id: Motorola_Moto_G_Power_real_us # Motorola Moto G Power - api 29 (10)
- id: OnePlus_6T_real # OnePlus 6T - api 29 (10)

# At the time of writing (July, 4, 2022), the market share per android version is:
# 12.0 = 17.54%, 11.0 = 31.65%, 10.0 = 21.92%
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Accept manifest integer values when requiring floating values ([#3823](https://github.com/getsentry/sentry-java/pull/3823))

## 7.16.0

### Features
Expand All @@ -20,6 +26,10 @@
- Load lazy fields on init in the background ([#3803](https://github.com/getsentry/sentry-java/pull/3803))
- Replace setOf with HashSet.add ([#3801](https://github.com/getsentry/sentry-java/pull/3801))

### Breaking changes

- The method `addIntegrationToSdkVersion(Ljava/lang/Class;)V` has been removed from the core (`io.sentry:sentry`) package. Please make sure all of the packages (e.g. `io.sentry:sentry-android-core`, `io.sentry:sentry-android-fragment`, `io.sentry:sentry-okhttp` and others) are all aligned and using the same version to prevent the `NoSuchMethodError` exception.

## 7.16.0-alpha.1

### Features
Expand Down
11 changes: 5 additions & 6 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,17 @@ object Config {
}

object TestLibs {
private val androidxTestVersion = "1.5.0"
private val espressoVersion = "3.5.0"

val androidJUnitRunner = "androidx.test.runner.AndroidJUnitRunner"
val kotlinTestJunit = "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
val androidxCore = "androidx.test:core:$androidxTestVersion"
val androidxRunner = "androidx.test:runner:$androidxTestVersion"
val androidxTestCoreKtx = "androidx.test:core-ktx:$androidxTestVersion"
val androidxTestRules = "androidx.test:rules:$androidxTestVersion"
val androidxCore = "androidx.test:core:1.6.1"
val androidxRunner = "androidx.test:runner:1.6.2"
val androidxTestCoreKtx = "androidx.test:core-ktx:1.6.1"
val androidxTestRules = "androidx.test:rules:1.6.1"
val espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion"
val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
val androidxTestOrchestrator = "androidx.test:orchestrator:1.4.2"
val androidxTestOrchestrator = "androidx.test:orchestrator:1.5.0"
val androidxJunit = "androidx.test.ext:junit:1.1.5"
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
val robolectric = "org.robolectric:robolectric:4.10.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ private static boolean readBool(
private static @NotNull Double readDouble(
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
// manifest meta-data only reads float
final Double value = ((Float) metadata.getFloat(key, -1)).doubleValue();
final Double value = ((Number) metadata.getFloat(key, metadata.getInt(key, -1))).doubleValue();
logger.log(SentryLevel.DEBUG, key + " read: " + value);
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1515,4 +1515,29 @@ class ManifestMetadataReaderTest {
assertTrue(fixture.options.experimental.sessionReplay.maskViewClasses.contains(SentryReplayOptions.IMAGE_VIEW_CLASS_NAME))
assertTrue(fixture.options.experimental.sessionReplay.maskViewClasses.contains(SentryReplayOptions.TEXT_VIEW_CLASS_NAME))
}

@Test
fun `applyMetadata reads integers even when expecting floats`() {
// Arrange
val expectedSampleRate: Int = 1

val bundle = bundleOf(
ManifestMetadataReader.SAMPLE_RATE to expectedSampleRate,
ManifestMetadataReader.TRACES_SAMPLE_RATE to expectedSampleRate,
ManifestMetadataReader.PROFILES_SAMPLE_RATE to expectedSampleRate,
ManifestMetadataReader.REPLAYS_SESSION_SAMPLE_RATE to expectedSampleRate,
ManifestMetadataReader.REPLAYS_ERROR_SAMPLE_RATE to expectedSampleRate
)
val context = fixture.getContext(metaData = bundle)

// Act
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)

// Assert
assertEquals(expectedSampleRate.toDouble(), fixture.options.sampleRate)
assertEquals(expectedSampleRate.toDouble(), fixture.options.tracesSampleRate)
assertEquals(expectedSampleRate.toDouble(), fixture.options.profilesSampleRate)
assertEquals(expectedSampleRate.toDouble(), fixture.options.experimental.sessionReplay.sessionSampleRate)
assertEquals(expectedSampleRate.toDouble(), fixture.options.experimental.sessionReplay.onErrorSampleRate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<!-- <meta-data android:name="io.sentry.traces.sample-rate" android:value="0.8" /> -->

<!-- how to enable profiling when starting transactions -->
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1" />

<!-- how to enable app start profiling -->
<meta-data android:name="io.sentry.traces.profiling.enable-app-start" android:value="true" />
Expand Down Expand Up @@ -165,7 +165,7 @@

<meta-data android:name="io.sentry.enable-metrics" android:value="true" />

<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1.0" />
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1" />
<meta-data android:name="io.sentry.session-replay.mask-all-text" android:value="true" />
</application>
</manifest>

0 comments on commit 2ee6559

Please sign in to comment.