Skip to content

Commit d83a571

Browse files
author
Ignacio Bonafonte
committed
Fix existing code and tests for the fixed merging logic
1 parent 7129c02 commit d83a571

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Instrumentation/SDKResourceExtension/DefaultResources.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class DefaultResources {
3131
let mirror = Mirror(reflecting: self)
3232
for children in mirror.children {
3333
if let provider = children.value as? ResourceProvider {
34-
resource = provider.create().merging(other: resource)
34+
resource.merge(other: provider.create())
3535
}
3636
}
3737
return resource

Tests/OpenTelemetrySdkTests/Resource/ResourceTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ResourceTest: XCTestCase {
4646
}
4747

4848
func testMergeResources() {
49-
let expectedLabelMap = ["a": AttributeValue.string("1"), "b": AttributeValue.string("2"), "c": AttributeValue.string("4")]
49+
let expectedLabelMap = ["a": AttributeValue.string("1"), "b": AttributeValue.string("3"), "c": AttributeValue.string("4")]
5050
let resource = defaultResource.merging(other: resource1).merging(other: resource2)
5151
XCTAssertEqual(resource.attributes, expectedLabelMap)
5252
}

0 commit comments

Comments
 (0)