From 90ae5b8136a6c74b230e1cd9e752935140b2f292 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 23 Dec 2025 15:05:37 +0100 Subject: [PATCH] cli/command: replace reflect for gotest.tools assertion Signed-off-by: Sebastiaan van Stijn --- cli/command/telemetry_utils_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/command/telemetry_utils_test.go b/cli/command/telemetry_utils_test.go index b5e3671f45..39c1dace60 100644 --- a/cli/command/telemetry_utils_test.go +++ b/cli/command/telemetry_utils_test.go @@ -4,14 +4,15 @@ import ( "bytes" "context" "io" - "reflect" "strings" "testing" "github.com/docker/cli/cli/streams" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/cobra" "go.opentelemetry.io/otel/attribute" "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func setupCobraCommands() (*cobra.Command, *cobra.Command, *cobra.Command) { @@ -139,7 +140,7 @@ func TestStdioAttributes(t *testing.T) { cli.Out().SetIsTerminal(tc.stdoutTty) actual := stdioAttributes(cli) - assert.Check(t, reflect.DeepEqual(actual, tc.expected)) + assert.Check(t, is.DeepEqual(actual, tc.expected, cmpopts.EquateComparable(attribute.Value{}))) }) } } @@ -179,7 +180,7 @@ func TestAttributesFromError(t *testing.T) { t.Run(tc.testName, func(t *testing.T) { t.Parallel() actual := attributesFromError(tc.err) - assert.Check(t, reflect.DeepEqual(actual, tc.expected)) + assert.Check(t, is.DeepEqual(actual, tc.expected, cmpopts.EquateComparable(attribute.Value{}))) }) } }