Skip to content

Commit

Permalink
test: Set log level to error performance scope test (#2968)
Browse files Browse the repository at this point in the history
Set log level to error for testPeformanceOfSyncToSentryCrash to avoid
spamming the raw test logs.
  • Loading branch information
philipphofmann authored Apr 27, 2023
1 parent bbe89d8 commit 861d361
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/SentryTests/SentryHubTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,18 @@ class SentryHubTests: XCTestCase {
}

func testBreadcrumbCapLimit() {
// To avoid spamming the test logs
SentryLog.configure(true, diagnosticLevel: .error)

let hub = fixture.getSut()

for _ in 0...100 {
addBreadcrumbThroughConfigureScope(hub)
}

assert(withScopeBreadcrumbsCount: 100, with: hub)

setTestDefaultLogLevel()
}

func testBreadcrumbOverDefaultLimit() {
Expand Down
6 changes: 6 additions & 0 deletions Tests/SentryTests/SentryScopeSwiftTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import SentryTestUtils
import XCTest

class SentryScopeSwiftTests: XCTestCase {
Expand Down Expand Up @@ -305,12 +306,17 @@ class SentryScopeSwiftTests: XCTestCase {
}

func testPeformanceOfSyncToSentryCrash() {
// To avoid spamming the test logs
SentryLog.configure(true, diagnosticLevel: .error)

let scope = fixture.scope
scope.add(SentryCrashScopeObserver(maxBreadcrumbs: 100))

self.measure {
modifyScope(scope: scope)
}

setTestDefaultLogLevel()
}

func testPeformanceOfSyncToSentryCrash_OneCrumb() {
Expand Down

0 comments on commit 861d361

Please sign in to comment.