Skip to content

Commit 24a1eec

Browse files
ref: Remove test deprecation warnings (#6548)
GH-6460 removed the deprecated enableAppLaunchProfiling option so we can remove the test deprecation warnings and a couple of other occurrences.
1 parent 37c5709 commit 24a1eec

18 files changed

+17
-113
lines changed

SentryTestUtilsTests/TestConstantTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class TestConstantTests: XCTestCase {
9898
XCTAssertEqual(sdkEvent.timestamp, date)
9999
}
100100

101-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
102101
func testEnvelope_shouldReturnValidEnvelopeWithOneItem() throws {
103102
// -- Act --
104103
let envelope = TestConstants.envelope

SentryTestUtilsTests/TestFileManagerTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class TestFileManagerTests: XCTestCase {
4545
sut = try fixture.getSut()
4646
}
4747

48-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
4948
func testStore_whenStoreEnvelopePathNilIsTrue_shouldRecordInvocationAndReturnNil() {
5049
// -- Arrange --
5150
let envelope = TestConstants.envelope
@@ -63,7 +62,6 @@ class TestFileManagerTests: XCTestCase {
6362
XCTAssertEqual(sut.storeEnvelopeInvocations.invocations.element(at: 1), envelope)
6463
}
6564

66-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
6765
func testStore_whenStoreEnvelopePathNilIsFalse_whenMockPathIsDefined_shouldRecordInvocationAndReturnMockPath() {
6866
// -- Arrange --
6967
let envelope = TestConstants.envelope
@@ -82,7 +80,6 @@ class TestFileManagerTests: XCTestCase {
8280
XCTAssertEqual(sut.storeEnvelopeInvocations.invocations.element(at: 1), envelope)
8381
}
8482

85-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
8683
func testStore_whenStoreEnvelopePathNilIsFalse_whenMockPathIsNotDefined_shouldRecordInvocationAndReturnActualPath() throws {
8784
// -- Arrange --
8885
let envelope = TestConstants.envelope

Sources/Sentry/Public/SentryOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ NS_SWIFT_NAME(Options)
432432
* @c 0.01 collects 1% of all trace data.
433433
* @note The value needs to be >= 0.0 and \<= 1.0. When setting a value out of range the SDK sets it
434434
* to the default of @c 0 .
435-
* @note If @c enableAppLaunchProfiling is @c YES , this function will be called during SDK start
436-
* with @c SentrySamplingContext.forNextAppLaunch set to @c YES, and the result will be persisted to
437-
* disk for use on the next app launch.
438435
*/
439436
@property (nullable, nonatomic) SentryTracesSamplerCallback tracesSampler NS_SWIFT_SENDABLE;
440437

Sources/Sentry/Public/SentryTransactionContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ SENTRY_NO_INIT
4949
@property (nonatomic, strong, nullable) NSNumber *parentSampleRand;
5050

5151
/**
52-
* If app launch profiling is enabled via @c SentryOptions.enableAppLaunchProfiling and
52+
* If app launch profiling is enabled via @c SentryProfileOptions.profileAppStarts and
5353
* @c SentryOptions.tracesSampler and/or @c SentryOptions.profilesSampler are defined,
5454
* @c SentrySDK.startWithOptions will call the sampler function with this property set to @c YES ,
5555
* and the returned value will be stored to disk for the next launch to calculate a sampling

Sources/Sentry/include/SentrySDKInternal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ SENTRY_NO_INIT
378378
* @c SentryOptions.profilesSampleRate or @c SentryOptions.profilesSampler . If either of those
379379
* options are set, this method does nothing.
380380
* @note Taking into account the above note, if @c SentryOptions.configureProfiling is not set,
381-
* calls to this method will always start a profile if one is not already running. This includes app
382-
* launch profiles configured with @c SentryOptions.enableAppLaunchProfiling .
381+
* calls to this method will always start a profile if one is not already running.
383382
* @note If neither @c SentryOptions.profilesSampleRate nor @c SentryOptions.profilesSampler are
384383
* set, and @c SentryOptions.configureProfiling is set, this method does nothing if the profiling
385384
* session is not sampled with respect to @c SentryOptions.profileSessionSampleRate , or if it is

Sources/Swift/Helper/SentrySDK.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ import Foundation
382382
/// `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler`. If either of those
383383
/// options are set, this method does nothing.
384384
/// - note: Taking into account the above note, if `SentryOptions.configureProfiling` is not set,
385-
/// calls to this method will always start a profile if one is not already running. This includes app
386-
/// launch profiles configured with `SentryOptions.enableAppLaunchProfiling`.
385+
/// calls to this method will always start a profile if one is not already running.
387386
/// - note: If neither `SentryOptions.profilesSampleRate` nor `SentryOptions.profilesSampler` are
388387
/// set, and `SentryOptions.configureProfiling` is set, this method does nothing if the profiling
389388
/// session is not sampled with respect to `SentryOptions.profileSessionSampleRate`, or if it is

Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@_spi(Private) @testable import Sentry
22
import XCTest
33

4-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
54
final class SentryEnabledFeaturesBuilderTests: XCTestCase {
65

76
func testDefaultFeatures() throws {

Tests/SentryTests/Helper/SentrySerializationTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class SentrySerializationTests: XCTestCase {
5353
XCTAssertNil(SentrySerializationSwift.data(with: envelope))
5454
}
5555

56-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
5756
func testEnvelopeWithData_InvalidEnvelopeItemHeaderJSON_ReturnsNil() throws {
5857
let envelopeItemHeader = SentryEnvelopeItemHeader(type: SentryInvalidJSONString() as String, length: 0)
5958
let envelopeItem = SentryEnvelopeItem(header: envelopeItemHeader, data: Data())
@@ -63,7 +62,6 @@ class SentrySerializationTests: XCTestCase {
6362
XCTAssertNil(SentrySerializationSwift.data(with: envelope))
6463
}
6564

66-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
6765
func testEnvelopeWithData_WithSingleEvent() throws {
6866
// Arrange
6967
let event = Event()
@@ -88,7 +86,6 @@ class SentrySerializationTests: XCTestCase {
8886
XCTAssertEqual(Date(timeIntervalSince1970: 9_001), deserializedEnvelope.header.sentAt)
8987
}
9088

91-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
9289
func testEnvelopeWithData_WithManyItems() throws {
9390
// Arrange
9491
let itemsCount = 15
@@ -127,7 +124,6 @@ class SentrySerializationTests: XCTestCase {
127124
}
128125
}
129126

130-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
131127
func testEnvelopeWithData_EmptyAttachment_ReturnsEnvelope() throws {
132128
// Arrange
133129
let itemData = Data()
@@ -158,7 +154,6 @@ class SentrySerializationTests: XCTestCase {
158154
XCTAssertEqual(sdkInfo, deserializedEnvelope.header.sdkInfo)
159155
}
160156

161-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
162157
func testEnvelopeWithData_WithTraceContext_ReturnsTraceContext() throws {
163158
let envelopeHeader = SentryEnvelopeHeader(id: nil, traceContext: Fixture.traceContext)
164159
let envelope = SentryEnvelope(header: envelopeHeader, singleItem: createItemWithEmptyAttachment())
@@ -170,7 +165,6 @@ class SentrySerializationTests: XCTestCase {
170165
assertTraceState(firstTrace: Fixture.traceContext, secondTrace: traceContext)
171166
}
172167

173-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
174168
func testEnvelopeWithData_TraceContextWithoutUser_ReturnsTraceContext() throws {
175169
let trace = TraceContext(trace: SentryId(), publicKey: "PUBLIC_KEY", releaseName: "RELEASE_NAME", environment: "TEST", transaction: "transaction", sampleRate: nil, sampled: nil, replayId: nil)
176170

@@ -184,7 +178,6 @@ class SentrySerializationTests: XCTestCase {
184178
assertTraceState(firstTrace: trace, secondTrace: traceContext)
185179
}
186180

187-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
188181
func testEnvelopeWithDataWithSampleRand_TraceContextWithoutUser_ReturnsTraceContext() throws {
189182
// -- Arrange --
190183
let trace = TraceContext(
@@ -627,7 +620,6 @@ class SentrySerializationTests: XCTestCase {
627620
XCTAssertNil(actual)
628621
}
629622

630-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
631623
func testReturnNilForCorruptedEnvelope() throws {
632624
let envelope = SentryEnvelope(event: Event(error: NSError(domain: "test", code: -1, userInfo: nil)))
633625
let data = try XCTUnwrap(SentrySerializationSwift.data(with: envelope))

Tests/SentryTests/Networking/RateLimits/SentryEnvelopeRateLimitTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
1919
sut.setDelegate(delegate)
2020
}
2121

22-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
2322
func testNoLimitsActive() {
2423
let envelope = getEnvelope()
2524

@@ -28,7 +27,6 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
2827
XCTAssertEqual(envelope, actual)
2928
}
3029

31-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
3230
func testLimitForErrorActive() {
3331
rateLimits.rateLimits = [SentryDataCategory.error]
3432

@@ -46,7 +44,6 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
4644
XCTAssertEqual(expected, delegate.envelopeItemsDropped.invocations)
4745
}
4846

49-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
5047
func testLimitForSessionActive() {
5148
rateLimits.rateLimits = [SentryDataCategory.session]
5249

@@ -64,7 +61,6 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
6461
XCTAssertEqual(expected, delegate.envelopeItemsDropped.invocations)
6562
}
6663

67-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
6864
func testLimitForCustomType() {
6965
rateLimits.rateLimits = [SentryDataCategory.default]
7066
var envelopeItems = [SentryEnvelopeItem]()
@@ -82,7 +78,6 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
8278
XCTAssertEqual(SentryEnvelopeItemTypes.event, try XCTUnwrap(actual.items.first).header.type)
8379
}
8480

85-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
8681
private func getEnvelope() -> SentryEnvelope {
8782
var envelopeItems = [SentryEnvelopeItem]()
8883
for _ in 0...2 {

Tests/SentryTests/Networking/SentryHttpTransportFlushIntegrationTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ final class SentryHttpTransportFlushIntegrationTests: XCTestCase {
2525
XCTAssertLessThan(blockingDurationAverage, 0.1)
2626
}
2727

28-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
2928
func testFlush_WhenNoInternet_BlocksAndFinishes() throws {
3029
let (sut, requestManager, fileManager, dispatchQueueWrapper) = try getSut()
3130
defer { fileManager.deleteAllFolders() }
@@ -52,7 +51,6 @@ final class SentryHttpTransportFlushIntegrationTests: XCTestCase {
5251
XCTAssertLessThan(blockingDurationAverage, 0.1)
5352
}
5453

55-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
5654
func testFlush_CallingFlushDirectlyAfterCapture_Flushes() throws {
5755
let (sut, _, fileManager, dispatchQueueWrapper) = try getSut()
5856
defer { fileManager.deleteAllFolders() }
@@ -68,7 +66,6 @@ final class SentryHttpTransportFlushIntegrationTests: XCTestCase {
6866
}
6967
}
7068

71-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
7269
func testFlushTimesOut_RequestManagerNeverFinishes_FlushingWorksNextTime() throws {
7370
let (sut, requestManager, fileManager, dispatchQueueWrapper) = try getSut()
7471
defer { fileManager.deleteAllFolders() }
@@ -89,7 +86,6 @@ final class SentryHttpTransportFlushIntegrationTests: XCTestCase {
8986
XCTAssertEqual(sut.flush(self.flushTimeout), .success, "Flush should not time out.")
9087
}
9188

92-
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
9389
func testFlush_CalledMultipleTimes_ImmediatelyReturnsFalse() throws {
9490
let (sut, requestManager, fileManager, dispatchQueueWrapper) = try getSut()
9591
defer { fileManager.deleteAllFolders() }

0 commit comments

Comments
 (0)