Drop the usage of knative.dev/pkg/test in the helpers package (#1791)

This has the side effects of pulling in a bunch of global variables
This commit is contained in:
Dave Protasowski 2020-10-09 11:37:21 -04:00 committed by GitHub
parent 73da5142da
commit 3eb7d13dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,6 @@ import (
"unicode"
"knative.dev/pkg/kmeta"
"knative.dev/pkg/test"
)
const (
@ -42,13 +41,17 @@ func init() {
rand.Seed(seed)
}
type named interface {
Name() string
}
// ObjectPrefixForTest returns the name prefix for this test's random names.
func ObjectPrefixForTest(t test.T) string {
func ObjectPrefixForTest(t named) string {
return MakeK8sNamePrefix(strings.TrimPrefix(t.Name(), testNamePrefix))
}
// ObjectNameForTest generates a random object name based on the test name.
func ObjectNameForTest(t test.T) string {
func ObjectNameForTest(t named) string {
return kmeta.ChildName(ObjectPrefixForTest(t), string(sep)+RandomString())
}