Skip to content

Commit 90ae5b8

Browse files
committed
cli/command: replace reflect for gotest.tools assertion
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent d20f30c commit 90ae5b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cli/command/telemetry_utils_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import (
44
"bytes"
55
"context"
66
"io"
7-
"reflect"
87
"strings"
98
"testing"
109

1110
"github.com/docker/cli/cli/streams"
11+
"github.com/google/go-cmp/cmp/cmpopts"
1212
"github.com/spf13/cobra"
1313
"go.opentelemetry.io/otel/attribute"
1414
"gotest.tools/v3/assert"
15+
is "gotest.tools/v3/assert/cmp"
1516
)
1617

1718
func setupCobraCommands() (*cobra.Command, *cobra.Command, *cobra.Command) {
@@ -139,7 +140,7 @@ func TestStdioAttributes(t *testing.T) {
139140
cli.Out().SetIsTerminal(tc.stdoutTty)
140141
actual := stdioAttributes(cli)
141142

142-
assert.Check(t, reflect.DeepEqual(actual, tc.expected))
143+
assert.Check(t, is.DeepEqual(actual, tc.expected, cmpopts.EquateComparable(attribute.Value{})))
143144
})
144145
}
145146
}
@@ -179,7 +180,7 @@ func TestAttributesFromError(t *testing.T) {
179180
t.Run(tc.testName, func(t *testing.T) {
180181
t.Parallel()
181182
actual := attributesFromError(tc.err)
182-
assert.Check(t, reflect.DeepEqual(actual, tc.expected))
183+
assert.Check(t, is.DeepEqual(actual, tc.expected, cmpopts.EquateComparable(attribute.Value{})))
183184
})
184185
}
185186
}

0 commit comments

Comments
 (0)