Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update module github.com/antonboom/testifylint to v1.5.0 #35797

Merged
merged 5 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/grouped_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func TestAddKubernetesWrapper(t *testing.T) {

jsonBytes, _ := json.Marshal(expectedCreatedObj)
addKubernetesWrapper(inputs)
assert.Equal(t, string(jsonBytes), inputs["kubernetes"], "The created and expected objects should be the same")
assert.JSONEq(t, string(jsonBytes), inputs["kubernetes"], "The created and expected objects should be the same")
})
}

Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/internal/translator/cause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func TestCauseWithStatusMessage(t *testing.T) {
require.NoError(t, w.Encode(cause))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, errorMsg))
assert.Contains(t, jsonStr, errorMsg)
}

func TestCauseWithHttpStatusMessage(t *testing.T) {
Expand All @@ -218,7 +218,7 @@ func TestCauseWithHttpStatusMessage(t *testing.T) {
require.NoError(t, w.Encode(cause))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, errorMsg))
assert.Contains(t, jsonStr, errorMsg)
}

func TestCauseWithZeroStatusMessageAndFaultHttpCode(t *testing.T) {
Expand Down
31 changes: 15 additions & 16 deletions exporter/awsxrayexporter/internal/translator/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package translator

import (
"strings"
"testing"
"time"

Expand All @@ -31,7 +30,7 @@ func TestClientSpanWithURLAttribute(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestClientSpanWithURLAttributeStable(t *testing.T) {
Expand All @@ -49,7 +48,7 @@ func TestClientSpanWithURLAttributeStable(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestClientSpanWithSchemeHostTargetAttributes(t *testing.T) {
Expand All @@ -70,7 +69,7 @@ func TestClientSpanWithSchemeHostTargetAttributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestClientSpanWithPeerAttributes(t *testing.T) {
Expand All @@ -95,7 +94,7 @@ func TestClientSpanWithPeerAttributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit"))
assert.Contains(t, jsonStr, "http://kb234.example.com:8080/users/junit")
}

func TestClientSpanWithPeerAttributesStable(t *testing.T) {
Expand All @@ -120,7 +119,7 @@ func TestClientSpanWithPeerAttributesStable(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit"))
assert.Contains(t, jsonStr, "http://kb234.example.com:8080/users/junit")
}

func TestClientSpanWithHttpPeerAttributes(t *testing.T) {
Expand Down Expand Up @@ -168,7 +167,7 @@ func TestClientSpanWithPeerIp4Attributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "http://10.8.17.36:8080/users/junit"))
assert.Contains(t, jsonStr, "http://10.8.17.36:8080/users/junit")
}

func TestClientSpanWithPeerIp6Attributes(t *testing.T) {
Expand All @@ -187,7 +186,7 @@ func TestClientSpanWithPeerIp6Attributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://2001:db8:85a3::8a2e:370:7334/users/junit"))
assert.Contains(t, jsonStr, "https://2001:db8:85a3::8a2e:370:7334/users/junit")
}

func TestServerSpanWithURLAttribute(t *testing.T) {
Expand All @@ -207,7 +206,7 @@ func TestServerSpanWithURLAttribute(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithURLAttributeStable(t *testing.T) {
Expand All @@ -227,7 +226,7 @@ func TestServerSpanWithURLAttributeStable(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithSchemeHostTargetAttributes(t *testing.T) {
Expand All @@ -248,7 +247,7 @@ func TestServerSpanWithSchemeHostTargetAttributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithSchemeHostTargetAttributesStable(t *testing.T) {
Expand All @@ -269,7 +268,7 @@ func TestServerSpanWithSchemeHostTargetAttributesStable(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithSchemeServernamePortTargetAttributes(t *testing.T) {
Expand All @@ -291,7 +290,7 @@ func TestServerSpanWithSchemeServernamePortTargetAttributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithSchemeServernamePortTargetAttributesStable(t *testing.T) {
Expand All @@ -313,7 +312,7 @@ func TestServerSpanWithSchemeServernamePortTargetAttributesStable(t *testing.T)
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "https://api.example.com/users/junit"))
assert.Contains(t, jsonStr, "https://api.example.com/users/junit")
}

func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) {
Expand All @@ -337,7 +336,7 @@ func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit"))
assert.Contains(t, jsonStr, "http://kb234.example.com:8080/users/junit")
}

func TestServerSpanWithSchemeNamePortTargetAttributesStable(t *testing.T) {
Expand All @@ -361,7 +360,7 @@ func TestServerSpanWithSchemeNamePortTargetAttributesStable(t *testing.T) {
require.NoError(t, w.Encode(httpData))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit"))
assert.Contains(t, jsonStr, "http://kb234.example.com:8080/users/junit")
}

func TestSpanWithNotEnoughHTTPRequestURLAttributes(t *testing.T) {
Expand Down
67 changes: 33 additions & 34 deletions exporter/awsxrayexporter/internal/translator/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"crypto/rand"
"encoding/binary"
"fmt"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -61,10 +60,10 @@ func TestClientSpanWithRpcAwsSdkClientAttributes(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDB"))
assert.True(t, strings.Contains(jsonStr, "GetItem"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "DynamoDB")
assert.Contains(t, jsonStr, "GetItem")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestClientSpanWithLegacyAwsSdkClientAttributes(t *testing.T) {
Expand Down Expand Up @@ -94,10 +93,10 @@ func TestClientSpanWithLegacyAwsSdkClientAttributes(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDB"))
assert.True(t, strings.Contains(jsonStr, "GetItem"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "DynamoDB")
assert.Contains(t, jsonStr, "GetItem")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestClientSpanWithPeerService(t *testing.T) {
Expand Down Expand Up @@ -253,8 +252,8 @@ func TestClientSpanWithDbComponent(t *testing.T) {
require.NoError(t, w.Encode(segment))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, spanName))
assert.True(t, strings.Contains(jsonStr, enterpriseAppID))
assert.Contains(t, jsonStr, spanName)
assert.Contains(t, jsonStr, enterpriseAppID)
}

func TestClientSpanWithHttpHost(t *testing.T) {
Expand Down Expand Up @@ -376,9 +375,9 @@ func TestSpanWithInvalidTraceIdWithoutTimestampValidation(t *testing.T) {

require.NoError(t, err)
assert.NotNil(t, jsonStr)
assert.True(t, strings.Contains(jsonStr, "ProducerService"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "ProducerService")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestSpanWithExpiredTraceIdWithoutTimestampValidation(t *testing.T) {
Expand Down Expand Up @@ -1088,9 +1087,9 @@ func TestClientSpanWithAwsRemoteServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "PaymentService"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "PaymentService")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestAwsSdkSpanWithDeprecatedAwsRemoteServiceName(t *testing.T) {
Expand All @@ -1115,10 +1114,10 @@ func TestAwsSdkSpanWithDeprecatedAwsRemoteServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDb"))
assert.False(t, strings.Contains(jsonStr, "DynamoDb.PutItem"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "DynamoDb")
assert.NotContains(t, jsonStr, "DynamoDb.PutItem")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestAwsSdkSpanWithAwsRemoteServiceName(t *testing.T) {
Expand All @@ -1143,10 +1142,10 @@ func TestAwsSdkSpanWithAwsRemoteServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDb"))
assert.False(t, strings.Contains(jsonStr, "DynamoDb.PutItem"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "DynamoDb")
assert.NotContains(t, jsonStr, "DynamoDb.PutItem")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestProducerSpanWithAwsRemoteServiceName(t *testing.T) {
Expand All @@ -1172,9 +1171,9 @@ func TestProducerSpanWithAwsRemoteServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "ProducerService"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "ProducerService")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestConsumerSpanWithAwsRemoteServiceName(t *testing.T) {
Expand All @@ -1191,9 +1190,9 @@ func TestConsumerSpanWithAwsRemoteServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "ConsumerService"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "ConsumerService")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func TestServerSpanWithAwsLocalServiceName(t *testing.T) {
Expand All @@ -1219,9 +1218,9 @@ func TestServerSpanWithAwsLocalServiceName(t *testing.T) {

assert.NotNil(t, jsonStr)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "PaymentLocalService"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, "user"))
assert.Contains(t, jsonStr, "PaymentLocalService")
assert.NotContains(t, jsonStr, user)
assert.NotContains(t, jsonStr, "user")
}

func validateLocalRootDependencySubsegment(t *testing.T, segment *awsxray.Segment, span ptrace.Span, parentID string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package translator

import (
"strings"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -23,7 +22,7 @@ func TestServiceFromResource(t *testing.T) {
require.NoError(t, w.Encode(service))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "semver:1.1.4"))
assert.Contains(t, jsonStr, "semver:1.1.4")
}

func TestServiceFromResourceWithNoServiceVersion(t *testing.T) {
Expand All @@ -36,7 +35,7 @@ func TestServiceFromResourceWithNoServiceVersion(t *testing.T) {
require.NoError(t, w.Encode(service))
jsonStr := w.String()
testWriters.release(w)
assert.True(t, strings.Contains(jsonStr, "v1"))
assert.Contains(t, jsonStr, "v1")
}

func TestServiceFromNullResource(t *testing.T) {
Expand Down
Loading