Skip to content

Commit 85715ad

Browse files
committed
Remove deprecation tags
1 parent ab49af5 commit 85715ad

12 files changed

+18
-128
lines changed

SentryTestUtils/TestOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public extension Options {
1010
enableCrashHandler = false
1111
swiftAsyncStacktraces = false
1212
enableAppHangTracking = false
13-
attachViewHierarchy = false
1413
enableNetworkTracking = false
1514
enableNetworkBreadcrumbs = false
1615
enableCaptureFailedRequests = false
1716
enableAutoBreadcrumbTracking = false
1817
#if (os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
18+
attachViewHierarchy = false
1919
enableUIViewControllerTracing = false
2020
#endif
2121
}

Tests/SentryProfilerTests/SentryProfilingPublicAPITests.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import XCTest
77
// swiftlint:disable file_length
88
class SentryProfilingPublicAPITests: XCTestCase {
99
private class Fixture {
10-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
1110
let options: Options = {
12-
let options = Options()
11+
let options = Options.noIntegrations()
1312
options.dsn = TestConstants.dsnAsString(username: "SentrySDKTests")
1413
options.releaseName = "1.0.0"
1514
return options
@@ -36,9 +35,7 @@ class SentryProfilingPublicAPITests: XCTestCase {
3635

3736
let currentDate = TestCurrentDateProvider()
3837
lazy var timerFactory = TestSentryNSTimerFactory(currentDateProvider: currentDate)
39-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
4038
lazy var client = TestClient(options: options)!
41-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
4239
lazy var hub = SentryHub(client: client, andScope: scope)
4340
}
4441

@@ -55,7 +52,6 @@ class SentryProfilingPublicAPITests: XCTestCase {
5552
SentryDependencyContainer.sharedInstance().dateProvider = fixture.currentDate
5653
}
5754

58-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
5955
override func tearDown() {
6056
super.tearDown()
6157

@@ -72,7 +68,6 @@ class SentryProfilingPublicAPITests: XCTestCase {
7268
}
7369

7470
// MARK: continuous profiling v2
75-
@available(*, deprecated, message: "This is only deprecated because profilesSampleRate is deprecated. Once that is removed this attribute can be removed.")
7671
extension SentryProfilingPublicAPITests {
7772
func testSentryOptionsReportsContinuousProfilingV2Enabled() {
7873
// Arrange
@@ -481,14 +476,12 @@ extension SentryProfilingPublicAPITests {
481476
}
482477

483478
private extension SentryProfilingPublicAPITests {
484-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
485479
func givenSdkWithHub() {
486480
SentrySDKInternal.setCurrentHub(fixture.hub)
487481
SentrySDKInternal.setStart(with: fixture.options)
488482
sentry_sdkInitProfilerTasks(fixture.options, fixture.hub)
489483
}
490484

491-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
492485
func givenSdkWithHubButNoClient() {
493486
SentrySDKInternal.setCurrentHub(SentryHub(client: nil, andScope: nil))
494487
SentrySDKInternal.setStart(with: fixture.options)

Tests/SentryTests/Integrations/Performance/IO/DataSentryTracingIntegrationTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class DataSentryTracingIntegrationTests: XCTestCase {
3535
options.dsn = TestConstants.dsnAsString(username: testName)
3636
options.removeAllIntegrations()
3737

38-
options.removeAllIntegrations()
3938
// Configure options required by File I/O tracking integration
4039
options.enableAutoPerformanceTracing = true
4140
options.enableFileIOTracing = isEnabled

Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerIntegrationTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class SentryNetworkTrackerIntegrationTests: XCTestCase {
2222
options.tracesSampleRate = 1.0
2323
options.removeAllIntegrations()
2424
options.enableNetworkTracking = true
25+
options.enableNetworkBreadcrumbs = true
26+
options.enableCaptureFailedRequests = true
2527
}
2628
}
2729

Tests/SentryTests/Integrations/SessionReplay/SentrySessionReplayIntegrationTests.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import XCTest
55

66
#if os(iOS) || os(tvOS)
77

8-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
98
class SentrySessionReplayIntegrationTests: XCTestCase {
109

1110
private var uiApplication: TestSentryUIApplication!
@@ -54,7 +53,10 @@ class SentrySessionReplayIntegrationTests: XCTestCase {
5453
private func startSDK(sessionSampleRate: Float, errorSampleRate: Float, enableSwizzling: Bool = true, noIntegrations: Bool = false, configure: ((Options) -> Void)? = nil) {
5554
SentrySDK.start {
5655
$0.dsn = "https://[email protected]/test"
57-
$0.sessionReplay = SentryReplayOptions(sessionSampleRate: sessionSampleRate, onErrorSampleRate: errorSampleRate)
56+
$0.removeAllIntegrations()
57+
if !noIntegrations {
58+
$0.sessionReplay = SentryReplayOptions(sessionSampleRate: sessionSampleRate, onErrorSampleRate: errorSampleRate)
59+
}
5860
$0.enableSwizzling = enableSwizzling
5961
$0.cacheDirectoryPath = FileManager.default.temporaryDirectory.path
6062
configure?($0)
@@ -114,7 +116,6 @@ class SentrySessionReplayIntegrationTests: XCTestCase {
114116

115117
func testInstallErrorReplay() {
116118
startSDK(sessionSampleRate: 0, errorSampleRate: 0.1)
117-
118119
XCTAssertEqual(SentrySDKInternal.currentHub().trimmedInstalledIntegrationNames().count, 1)
119120
XCTAssertEqual(globalEventProcessor.processors.count, 1)
120121
}

Tests/SentryTests/Integrations/ViewHierarchy/SentryViewHierarchyIntegrationTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
3636
clearTestState()
3737
}
3838

39-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
4039
func test_attachViewHierarchy() {
4140
SentrySDK.start {
4241
$0.removeAllIntegrations()
@@ -46,7 +45,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
4645
XCTAssertFalse(sentrycrash_hasSaveViewHierarchyCallback())
4746
}
4847

49-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
5048
func test_attachViewHierarchy_enabled() {
5149
SentrySDK.start {
5250
$0.removeAllIntegrations()
@@ -56,7 +54,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
5654
XCTAssertTrue(sentrycrash_hasSaveViewHierarchyCallback())
5755
}
5856

59-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
6057
func test_uninstall() {
6158
SentrySDK.start {
6259
$0.removeAllIntegrations()
@@ -67,7 +64,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
6764
XCTAssertFalse(sentrycrash_hasSaveViewHierarchyCallback())
6865
}
6966

70-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
7167
func test_integrationAddFileName() {
7268
SentrySDK.start {
7369
$0.removeAllIntegrations()
@@ -173,7 +169,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
173169
wait(for: [ex], timeout: 1)
174170
}
175171

176-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
177172
func testReportAccessibilityIdentifierTrue() {
178173
SentrySDK.start {
179174
$0.removeAllIntegrations()
@@ -182,7 +177,6 @@ class SentryViewHierarchyIntegrationTests: XCTestCase {
182177
XCTAssertTrue(SentryDependencyContainer.sharedInstance().viewHierarchyProvider.reportAccessibilityIdentifier)
183178
}
184179

185-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
186180
func testReportAccessibilityIdentifierFalse() {
187181
SentrySDK.start {
188182
$0.removeAllIntegrations()

Tests/SentryTests/PrivateSentrySDKOnlyTests.swift

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -349,17 +349,15 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
349349
#endif
350350

351351
#if canImport(UIKit)
352-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
353352
func testCaptureReplayShouldCallReplayIntegration() {
354353
guard #available(iOS 16.0, tvOS 16.0, *) else { return }
355354

356-
let options = Options()
357-
options.setIntegrations([TestSentrySessionReplayIntegration.self])
355+
let options = Options.noIntegrations()
358356
SentrySDKInternal.start(options: options)
359357

360358
PrivateSentrySDKOnly.captureReplay()
361359

362-
XCTAssertTrue(TestSentrySessionReplayIntegration.captureReplayShouldBeCalledAtLeastOnce())
360+
// TODO: Swizzle the captureReplay method
363361
}
364362

365363
func testGetReplayIdShouldBeNil() {
@@ -375,31 +373,28 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
375373
XCTAssertEqual(PrivateSentrySDKOnly.getReplayId(), VALID_REPLAY_ID)
376374
}
377375

378-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
379376
func testAddReplayIgnoreClassesShouldNotFailWhenReplayIsAvailable() {
380-
let options = Options()
381-
options.setIntegrations([TestSentrySessionReplayIntegration.self])
377+
let options = Options.noIntegrations()
378+
options.sessionReplay = .init()
382379
SentrySDKInternal.start(options: options)
383380

384381
PrivateSentrySDKOnly.addReplayIgnoreClasses([UILabel.self])
385382
}
386383

387-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
388384
func testAddReplayRedactShouldNotFailWhenReplayIsAvailable() {
389385
let options = Options()
390-
options.setIntegrations([TestSentrySessionReplayIntegration.self])
386+
options.sessionReplay = .init()
391387
SentrySDKInternal.start(options: options)
392388

393389
PrivateSentrySDKOnly.addReplayRedactClasses([UILabel.self])
394390
}
395391

396-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
397392
func testAddIgnoreContainer() throws {
398393
class IgnoreContainer: UIView {}
399394

400395
SentrySDKInternal.start {
396+
$0.removeAllIntegrations()
401397
$0.sessionReplay = SentryReplayOptions(sessionSampleRate: 1, onErrorSampleRate: 1)
402-
$0.setIntegrations([SentrySessionReplayIntegration.self])
403398
}
404399

405400
PrivateSentrySDKOnly.setIgnoreContainerClass(IgnoreContainer.self)
@@ -410,13 +405,12 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
410405
XCTAssertTrue(redactBuilder.isIgnoreContainerClassTestOnly(IgnoreContainer.self))
411406
}
412407

413-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
414408
func testAddRedactContainer() throws {
415409
class RedactContainer: UIView {}
416410

417411
SentrySDKInternal.start {
412+
$0.removeAllIntegrations()
418413
$0.sessionReplay = SentryReplayOptions(sessionSampleRate: 1, onErrorSampleRate: 1)
419-
$0.setIntegrations([SentrySessionReplayIntegration.self])
420414
}
421415

422416
PrivateSentrySDKOnly.setRedactContainerClass(RedactContainer.self)
@@ -451,23 +445,6 @@ class PrivateSentrySDKOnlyTests: XCTestCase {
451445
}
452446

453447
private let VALID_REPLAY_ID = "0eac7ab503354dd5819b03e263627a29"
454-
455-
private class TestSentrySessionReplayIntegration: SentrySessionReplayIntegration {
456-
static var captureReplayCalledTimes = 0
457-
458-
override func install(with options: Options) -> Bool {
459-
return true
460-
}
461-
462-
override func captureReplay() -> Bool {
463-
TestSentrySessionReplayIntegration.captureReplayCalledTimes += 1
464-
return true
465-
}
466-
467-
static func captureReplayShouldBeCalledAtLeastOnce() -> Bool {
468-
return captureReplayCalledTimes > 0
469-
}
470-
}
471448
#endif
472449

473450
private func getUnhandledExceptionEnvelope() -> SentryEnvelope {

Tests/SentryTests/SentryClientTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import XCTest
55
// swiftlint:disable file_length
66
// We are aware that the client has a lot of logic and we should maybe
77
// move some of it to other classes.
8-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
98
class SentryClientTests: XCTestCase {
109

1110
private static let dsn = TestConstants.dsnAsString(username: "SentryClientTest")
@@ -1728,7 +1727,9 @@ class SentryClientTests: XCTestCase {
17281727
}
17291728

17301729
func testSetSDKFeatures() throws {
1731-
let sut = fixture.getSut()
1730+
let sut = fixture.getSut { options in
1731+
options.enableCaptureFailedRequests = true
1732+
}
17321733

17331734
sut.capture(message: "message")
17341735

@@ -2231,7 +2232,6 @@ class SentryClientTests: XCTestCase {
22312232
}
22322233
}
22332234

2234-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
22352235
private extension SentryClientTests {
22362236
private func givenEventWithDebugMeta() -> Event {
22372237
let event = Event(level: SentryLevel.fatal)

Tests/SentryTests/SentryCrash/SentryCrashInstallationReporterTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class SentryCrashInstallationReporterTests: XCTestCase {
1414
sut.uninstall()
1515
}
1616

17-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
1817
func testReportIsSentAndDeleted() throws {
1918
givenSutWithStartedSDK()
2019

@@ -31,7 +30,6 @@ class SentryCrashInstallationReporterTests: XCTestCase {
3130
/**
3231
* Validates that handling a crash report with the removed fields total_storage and free_storage works.
3332
*/
34-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
3533
func testShouldCaptureCrashReportWithLegacyStorageInfo() throws {
3634
givenSutWithStartedSDK()
3735

@@ -50,7 +48,6 @@ class SentryCrashInstallationReporterTests: XCTestCase {
5048
XCTAssertEqual(event?.context?["device"]?["storage_size"] as? Int, 994_662_584_320)
5149
}
5250

53-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
5451
func testShouldCaptureCrashReportWithoutDeviceContext() throws {
5552
givenSutWithStartedSDK()
5653

@@ -68,7 +65,6 @@ class SentryCrashInstallationReporterTests: XCTestCase {
6865
XCTAssertEqual(event?.context?["app"]?["app_name"] as? String, "iOS-Swift")
6966
}
7067

71-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
7268
func testFaultyReportIsNotSentAndDeleted() throws {
7369
givenSutWithStartedSDK()
7470

@@ -82,7 +78,6 @@ class SentryCrashInstallationReporterTests: XCTestCase {
8278
XCTAssertEqual(sentrycrash_getReportCount(), 0)
8379
}
8480

85-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
8681
private func givenSutWithStartedSDK() {
8782
let options = Options()
8883
options.dsn = TestConstants.dsnAsString(username: "SentryCrashInstallationReporterTests")

Tests/SentryTests/SentryCrash/SentryStacktraceBuilderTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class SentryStacktraceBuilderTests: XCTestCase {
7676
)
7777
}
7878

79-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
8079
func testConcurrentStacktraces() throws {
8180
guard #available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) else {
8281
throw XCTSkip("Not available for earlier platform versions")
@@ -102,7 +101,6 @@ class SentryStacktraceBuilderTests: XCTestCase {
102101
wait(for: [waitForAsyncToRun], timeout: 10)
103102
}
104103

105-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
106104
func testConcurrentStacktraces_noStitching() throws {
107105
guard #available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) else {
108106
throw XCTSkip("Not available for earlier platform versions")

0 commit comments

Comments
 (0)