mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #49603 from zhangxiaoyu-zidif/fix-errorf-for-get-test
Automatic merge from submit-queue (batch tested with PRs 49524, 46760, 50206, 50166, 49603) Fix errorf for get test **What this PR does / why we need it**: If the error messages do not use format, use t.Error() will be fine. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
4217e10b9f
@ -212,7 +212,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ func TestGetObjects(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ func TestGetSortedObjects(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@ func TestGetListObjects(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -542,7 +542,7 @@ func TestGetAllListObjects(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -571,7 +571,7 @@ func TestGetListComponentStatus(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,7 +610,7 @@ func TestGetMultipleTypeObjects(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ func TestGetMultipleTypeObjectsWithSelector(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -764,7 +764,7 @@ func TestGetMultipleTypeObjectsWithDirectReference(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -789,7 +789,7 @@ func TestGetByFormatForcesFlag(t *testing.T) {
|
||||
|
||||
showAllFlag, _ := cmd.Flags().GetBool("show-all")
|
||||
if showAllFlag {
|
||||
t.Errorf("expected showAll to not be true when getting resource")
|
||||
t.Error("expected showAll to not be true when getting resource")
|
||||
}
|
||||
}
|
||||
|
||||
@ -909,7 +909,7 @@ func TestWatchSelector(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -951,7 +951,7 @@ func TestWatchResource(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -994,7 +994,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -1036,7 +1036,7 @@ func TestWatchOnlyResource(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -1082,7 +1082,7 @@ func TestWatchOnlyList(t *testing.T) {
|
||||
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)
|
||||
|
||||
if len(buf.String()) == 0 {
|
||||
t.Errorf("unexpected empty output")
|
||||
t.Error("unexpected empty output")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user