-
-
Notifications
You must be signed in to change notification settings - Fork 19
fix: beforeSend overriding default release even if it was not set #376
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
Merged
Merged
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2b0f3a8
Update
buenaflor 36ab625
Update SentryBridgeTest.apple.kt
buenaflor afb4c15
Merge branch 'main' into fix/init-with-platforms
buenaflor 37405f6
Update CHANGELOG
buenaflor 4cb4c02
Update
buenaflor cd56975
Update
buenaflor 0a229ed
Podspec
buenaflor 2c6ba5f
Fix syncing between kmp event and native event
buenaflor ab925d3
Revert open
buenaflor 423bd6b
Formatting
buenaflor 7fe3bd2
Remove print
buenaflor 5437879
Merge branch 'main' into fix/def-release
buenaflor 2bfdbb9
Update CHANGELOG
buenaflor aa9d034
Update
buenaflor 4b0646f
Update
buenaflor 5e8aeac
Update
buenaflor 32932d5
Merge branch 'main' into fix/def-release
buenaflor 5091311
Update
buenaflor de816fd
Update
buenaflor b0cc5e7
Update
buenaflor 756d084
Update
buenaflor d763a7f
Merge branch 'main' into fix/def-release
buenaflor 5b7eb17
Update CHANGELOG.md
buenaflor b5cc56d
Update dist impl as well
buenaflor 6a334f7
Update CHANGELOG
buenaflor 865d695
Remove old dist
buenaflor f659b21
Formatting
buenaflor 3915445
Merge branch 'main' into fix/def-release
buenaflor 8e3d796
Merge branch 'main' into fix/def-release
buenaflor 35275a6
Fix apple test
buenaflor 9ba7a99
Formatting
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
52 changes: 52 additions & 0 deletions
52
...in-multiplatform/src/appleTest/kotlin/io/sentry/kotlin/multiplatform/ApplyKmpEventTest.kt
This file contains hidden or 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,52 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
import io.sentry.kotlin.multiplatform.extensions.applyKmpEvent | ||
import kotlin.test.Test | ||
import kotlin.test.assertFalse | ||
|
||
class ApplyKmpEventTest { | ||
@Test | ||
fun `native release is not set if kmp release has same value`() { | ||
val nativeEvent = FakeSentryEvent().apply { | ||
releaseName = "1.0.0" | ||
} | ||
val kmpEvent = SentryEvent().apply { | ||
release = "1.0.0" | ||
} | ||
|
||
nativeEvent.applyKmpEvent(kmpEvent) | ||
|
||
assertFalse(nativeEvent.wasReleaseSet) | ||
} | ||
|
||
@Test | ||
fun `native dist is not set if kmp dist has same value`() { | ||
val nativeEvent = FakeSentryEvent().apply { | ||
dist = "randomDist" | ||
} | ||
val kmpEvent = SentryEvent().apply { | ||
dist = "randomDist" | ||
} | ||
|
||
nativeEvent.applyKmpEvent(kmpEvent) | ||
|
||
assertFalse(nativeEvent.wasDistSet) | ||
} | ||
} | ||
|
||
// init with a SentryLevel as a workaround for: | ||
// Unable to call non-designated initializer as super constructor | ||
private class FakeSentryEvent : CocoaSentryEvent(Internal.Sentry.kSentryLevelFatal) { | ||
var wasReleaseSet = false | ||
var wasDistSet = false | ||
|
||
override fun setReleaseName(releaseName: String?) { | ||
super.setReleaseName(releaseName) | ||
wasReleaseSet = true | ||
} | ||
|
||
override fun setDist(dist: String?) { | ||
super.setDist(dist) | ||
wasDistSet = true | ||
} | ||
} |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can only test on cocoa - on java the
SentryEvent
is final and we don't use a mocking framework yet