Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhlogin committed Dec 19, 2024
1 parent 632d53d commit 7461977
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
15 changes: 0 additions & 15 deletions exporter/awsxrayexporter/internal/translator/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,6 @@ func TestCustomSDK(t *testing.T) {
assert.Equal(t, "2.0.3", *awsData.XRay.SDKVersion)
}

func TestCustomSDKForLanguage(t *testing.T) {
attributes := make(map[string]pcommon.Value)
resource := pcommon.NewResource()
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKName, "test for java")
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKLanguage, "java")
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKVersion, "2.0.3")

filtered, awsData := makeAws(attributes, resource, nil)

assert.NotNil(t, filtered)
assert.NotNil(t, awsData)
assert.Equal(t, "test for java", *awsData.XRay.SDK)
assert.Equal(t, "2.0.3", *awsData.XRay.SDKVersion)
}

func TestLogGroups(t *testing.T) {
cwl1 := awsxray.LogGroupMetadata{
LogGroup: awsxray.String("group1"),
Expand Down
8 changes: 4 additions & 4 deletions exporter/awsxrayexporter/internal/translator/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestClientSpanWithSchemeHostTargetAttributesStable(t *testing.T) {
attributes := make(map[string]any)
attributes[conventionsv127.AttributeHTTPRequestMethod] = "GET"
attributes[conventionsv127.AttributeURLScheme] = "https"
attributes[conventionsv127.AttributeServerAddress] = "api.example.com"
attributes[conventions.AttributeHTTPHost] = "api.example.com"
attributes[conventionsv127.AttributeURLQuery] = "/users/junit"
attributes[conventionsv127.AttributeHTTPResponseStatusCode] = 200
attributes["user.id"] = "junit"
Expand Down Expand Up @@ -125,9 +125,9 @@ func TestClientSpanWithPeerAttributesStable(t *testing.T) {
attributes := make(map[string]any)
attributes[conventionsv127.AttributeHTTPRequestMethod] = http.MethodGet
attributes[conventionsv127.AttributeURLScheme] = "http"
attributes[conventionsv127.AttributeServerAddress] = "kb234.example.com"
attributes[conventionsv127.AttributeServerPort] = 8080
attributes[conventionsv127.AttributeNetworkPeerAddress] = "10.8.17.36"
attributes[conventions.AttributeNetPeerName] = "kb234.example.com"
attributes[conventions.AttributeNetPeerPort] = 8080
attributes[conventions.AttributeNetPeerIP] = "10.8.17.36"
attributes[conventionsv127.AttributeURLQuery] = "/users/junit"
attributes[conventionsv127.AttributeHTTPResponseStatusCode] = 200
span := constructHTTPClientSpan(attributes)
Expand Down

0 comments on commit 7461977

Please sign in to comment.