Cleanup printer test package.

Updates internalversion BUILD file dependencies

Removes pkg/printers/internalversion from staticcheck failures
This commit is contained in:
Sean Sullivan 2019-10-11 13:28:21 -07:00
parent cc56738a9e
commit 30d8a93768
3 changed files with 2 additions and 41 deletions

View File

@ -28,7 +28,6 @@ pkg/kubelet/pluginmanager/pluginwatcher
pkg/kubelet/remote
pkg/master
pkg/printers
pkg/printers/internalversion
pkg/probe/http
pkg/proxy/healthcheck
pkg/proxy/iptables

View File

@ -20,12 +20,14 @@ go_test(
"//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/apis/certificates:go_default_library",
"//pkg/apis/coordination:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/discovery:go_default_library",
"//pkg/apis/networking:go_default_library",
"//pkg/apis/node:go_default_library",
"//pkg/apis/policy:go_default_library",
"//pkg/apis/rbac:go_default_library",
"//pkg/apis/scheduling:go_default_library",
"//pkg/apis/storage:go_default_library",
"//pkg/printers:go_default_library",

View File

@ -17,9 +17,7 @@ limitations under the License.
package internalversion
import (
"bytes"
"reflect"
"strings"
"testing"
"time"
@ -4757,41 +4755,3 @@ func TestPrintEndpointSlice(t *testing.T) {
}
}
}
func verifyTable(t *testing.T, table *metav1beta1.Table) {
var panicErr interface{}
func() {
defer func() {
panicErr = recover()
}()
table.DeepCopyObject() // cells are untyped, better check that types are JSON types and can be deep copied
}()
if panicErr != nil {
t.Errorf("unexpected panic during deepcopy of table %#v: %v", table, panicErr)
}
}
// VerifyDatesInOrder checks the start of each line for a RFC1123Z date
// and posts error if all subsequent dates are not equal or increasing
func VerifyDatesInOrder(
resultToTest, rowDelimiter, columnDelimiter string, t *testing.T) {
lines := strings.Split(resultToTest, rowDelimiter)
var previousTime time.Time
for _, str := range lines {
columns := strings.Split(str, columnDelimiter)
if len(columns) > 0 {
currentTime, err := time.Parse(time.RFC1123Z, columns[0])
if err == nil {
if previousTime.After(currentTime) {
t.Errorf(
"Output is not sorted by time. %s should be listed after %s. Complete output: %s",
previousTime.Format(time.RFC1123Z),
currentTime.Format(time.RFC1123Z),
resultToTest)
}
previousTime = currentTime
}
}
}
}