Merge pull request #113423 from sss-ng/bugfix/fix-cmd-test

fixed kubectl test that passes when it should fail on changed test input
This commit is contained in:
Kubernetes Prow Robot 2022-10-28 07:32:43 -07:00 committed by GitHub
commit 367f01f62d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@ import (
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
@ -143,7 +145,7 @@ func TestKubectlCommandHandlesPlugins(t *testing.T) {
t.Fatalf("unexpected plugin execution: expected %q, got %q", test.expectPlugin, pluginsHandler.executedPlugin)
}
if len(pluginsHandler.withArgs) != len(test.expectPluginArgs) {
if !cmp.Equal(pluginsHandler.withArgs, test.expectPluginArgs, cmpopts.EquateEmpty()) {
t.Fatalf("unexpected plugin execution args: expected %q, got %q", test.expectPluginArgs, pluginsHandler.withArgs)
}
})