From ba3145ab2961ed0b2cb53d419dbc3c234bb8fde4 Mon Sep 17 00:00:00 2001 From: Daniel Bedrood Date: Fri, 22 Sep 2023 13:15:48 +0200 Subject: [PATCH] chore: Replace go-cmp with testify --- go.mod | 1 - pkg/instrumentation/database_test.go | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8aa9ac21..c805f4be 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/DataDog/datadog-go v4.8.2+incompatible github.com/aws/aws-sdk-go v1.34.28 github.com/getsentry/sentry-go v0.12.0 - github.com/google/go-cmp v0.5.7 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 github.com/magefile/mage v1.13.0 diff --git a/pkg/instrumentation/database_test.go b/pkg/instrumentation/database_test.go index de7d2e31..8d788437 100644 --- a/pkg/instrumentation/database_test.go +++ b/pkg/instrumentation/database_test.go @@ -5,7 +5,7 @@ import ( "path" "testing" - "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/mocktracer" "gorm.io/driver/sqlite" "gorm.io/gorm" @@ -72,7 +72,7 @@ func TestInstrumentDatabase(t *testing.T) { { name: "DELETE", tags: map[string]interface{}{ - "db.count": int64(1), + "db.count": int64(2), "db.err": nil, "db.table": "test_records", "service.name": "test_app_name-mysql", @@ -130,9 +130,7 @@ func TestInstrumentDatabase(t *testing.T) { t.Errorf("Got span: %s, expected: %s", actualName, expectedName) } - if diff := cmp.Diff(expectedTags, actualTags); diff != "" { - t.Error(diff) - } + assert.Equal(t, expectedTags, actualTags, "database tags didn't match") } }