This repository was archived by the owner on Aug 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: envelope header has sdkVersion and not sdkInfo (#488)
- Loading branch information
1 parent
c8dbbad
commit 89da1a3
Showing
27 changed files
with
309 additions
and
282 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
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
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
2 changes: 1 addition & 1 deletion
2
...st/resources/envelope_session_sdkinfo.txt → ...resources/envelope_session_sdkversion.txt
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{"sdk_info":{"sdk_name":"test","version_major":1,"version_minor":2,"version_patchlevel":3}} | ||
{"sdk":{"name":"test","version":"1.2.3","integrations":["NdkIntegration"],"packages":[{"name":"maven:sentry-android-core","version":"4.5.6"}]}} | ||
{"content_type":"application/json","type":"session","length":306} | ||
{"sid":"c81d4e2e-bcf2-11e6-869b-7df92533d2db","did":"123","init":true,"started":"2020-02-07T14:16:00Z","status":"ok","seq":123456,"errors":2,"duration":6000.0,"timestamp":"2020-02-07T14:16:00Z","attrs":{"release":"io.sentry@1.0+123","environment":"debug","ip_address":"127.0.0.1","user_agent":"jamesBond"}} |
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
24 changes: 24 additions & 0 deletions
24
sentry-android-ndk/src/main/java/io/sentry/android/ndk/SentryNdkUtil.java
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,24 @@ | ||
package io.sentry.android.ndk; | ||
|
||
import io.sentry.core.protocol.SdkVersion; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Util class to make SentryNdk testable, as SentryNdk inits native libraries and it breaks on init. | ||
*/ | ||
final class SentryNdkUtil { | ||
|
||
private SentryNdkUtil() {} | ||
|
||
/** | ||
* Adds the sentry-android-ndk package into the package list | ||
* | ||
* @param sdkVersion the SdkVersion object | ||
*/ | ||
static void addPackage(@Nullable final SdkVersion sdkVersion) { | ||
if (sdkVersion == null) { | ||
return; | ||
} | ||
sdkVersion.addPackage("maven:sentry-android-ndk", BuildConfig.VERSION_NAME); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
sentry-android-ndk/src/test/java/io/sentry/android/ndk/SentryNdkUtilTest.kt
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,30 @@ | ||
package io.sentry.android.ndk | ||
|
||
import io.sentry.core.SentryOptions | ||
import io.sentry.core.protocol.SdkVersion | ||
import kotlin.test.Test | ||
import kotlin.test.assertNull | ||
import kotlin.test.assertTrue | ||
|
||
class SentryNdkUtilTest { | ||
|
||
@Test | ||
fun `SentryNdk adds the Ndk package into the package list`() { | ||
val options = SentryOptions().apply { | ||
sdkVersion = SdkVersion() | ||
} | ||
SentryNdkUtil.addPackage(options.sdkVersion) | ||
assertTrue(options.sdkVersion!!.packages!!.any { | ||
it.name == "maven:sentry-android-ndk" | ||
it.version == BuildConfig.VERSION_NAME | ||
}) | ||
} | ||
|
||
@Test | ||
fun `SentryNdk do not add the Ndk package into the package list`() { | ||
val options = SentryOptions() | ||
SentryNdkUtil.addPackage(options.sdkVersion) | ||
|
||
assertNull(options.sdkVersion?.packages) | ||
} | ||
} |
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
Oops, something went wrong.