Skip to content

Commit

Permalink
RUMM-2334 Use RUM attributes keys in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxep committed Oct 7, 2022
1 parent 13636b4 commit 5ae5a25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Tests/DatadogTests/Datadog/LoggerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -488,19 +488,19 @@ class LoggerTests: XCTestCase {
// then
let logMatcher = try logging.waitAndReturnLogMatchers(count: 1)[0]
logMatcher.assertValue(
forKeyPath: "application_id",
forKeyPath: RUMMonitor.Attributes.applicationID,
equals: rum.configuration.applicationID
)
logMatcher.assertValue(
forKeyPath: "session_id",
forKeyPath: RUMMonitor.Attributes.sessionID,
isTypeOf: String.self
)
logMatcher.assertValue(
forKeyPath: "view.id",
forKeyPath: RUMMonitor.Attributes.viewID,
isTypeOf: String.self
)
logMatcher.assertValue(
forKeyPath: "user_action.id",
forKeyPath: RUMMonitor.Attributes.userActionID,
isTypeOf: String.self
)
}
Expand Down
12 changes: 6 additions & 6 deletions Tests/DatadogTests/Datadog/TracerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,11 @@ class TracerTests: XCTestCase {
// then
let spanMatcher = try tracing.waitAndReturnSpanMatchers(count: 1)[0]
XCTAssertEqual(
try spanMatcher.meta.custom(keyPath: "meta.application_id"),
try spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.applicationID)"),
rum.configuration.applicationID
)
XCTAssertValidRumUUID(try spanMatcher.meta.custom(keyPath: "meta.session_id"))
XCTAssertValidRumUUID(try spanMatcher.meta.custom(keyPath: "meta.view.id"))
XCTAssertValidRumUUID(try spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.sessionID)"))
XCTAssertValidRumUUID(try spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.viewID)"))
}

func testGivenBundlingWithRUMEnabledButRUMMonitorNotRegistered_whenSendingSpan_itPrintsWarning() throws {
Expand All @@ -697,9 +697,9 @@ class TracerTests: XCTestCase {

// then
let spanMatcher = try tracing.waitAndReturnSpanMatchers(count: 1)[0]
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.application_id"))
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.session_id"))
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.view.id"))
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.applicationID)"))
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.sessionID)"))
XCTAssertNil(try? spanMatcher.meta.custom(keyPath: "meta.\(RUMMonitor.Attributes.viewID)"))
}

// MARK: - Injecting span context into carrier
Expand Down

0 comments on commit 5ae5a25

Please sign in to comment.