Skip to content

Commit

Permalink
Fixing SpanErrorCode.userAbandon raw string value (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoEmbrace authored Dec 12, 2024
1 parent 69ed424 commit 949d7ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/EmbraceSemantics/Span/SpanErrorCode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public enum SpanErrorCode: String {
case failure

/// Span ended because user reverted intent
case userAbandon
case userAbandon = "user_abandon"

/// Span ended in some other way
case unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class Embrace_OTelIntegrationTests: IntegrationTestCase {
if let result = exporter.exportedSpans.values.first(where: { value in
value.name == "my-example-span"
}) {
XCTAssertEqual(result.status, .error(description: "userAbandon"))
XCTAssertEqual(result.status, .error(description: "user_abandon"))
expectation.fulfill()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ final class SingleSpanProcessorTests: XCTestCase {
let exportedSpan = try XCTUnwrap(self.exporter.exportedSpans[span.context.spanId])
return exportedSpan.hasEnded &&
exportedSpan.status.isError &&
exportedSpan.attributes[SpanSemantics.keyErrorCode] == .string("userAbandon")
exportedSpan.attributes[SpanSemantics.keyErrorCode] == .string("user_abandon")
}
}

Expand All @@ -232,10 +232,10 @@ final class SingleSpanProcessorTests: XCTestCase {

return span1.hasEnded &&
span1.status.isError &&
span1.attributes[SpanSemantics.keyErrorCode] == .string("userAbandon") &&
span1.attributes[SpanSemantics.keyErrorCode] == .string("user_abandon") &&
span2.hasEnded &&
span2.status.isError &&
span2.attributes[SpanSemantics.keyErrorCode] == .string("userAbandon")
span2.attributes[SpanSemantics.keyErrorCode] == .string("user_abandon")
}
}
}

0 comments on commit 949d7ee

Please sign in to comment.