Simplify plugin tests.

This commit is contained in:
Jeffrey Regan
2019-12-02 13:17:52 -08:00
parent 0a19a5dbd9
commit 861c86a70a
37 changed files with 375 additions and 632 deletions

View File

@@ -21,21 +21,23 @@ import (
func makeKustTarget(
t *testing.T,
fSys filesys.FileSystem, path string) *target.KustTarget {
fSys filesys.FileSystem,
root string) *target.KustTarget {
return makeKustTargetWithRf(
t, fSys, path,
t, fSys, root,
resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl()))
}
func makeKustTargetWithRf(
t *testing.T,
fSys filesys.FileSystem, path string,
fSys filesys.FileSystem,
root string,
resFact *resource.Factory) *target.KustTarget {
rf := resmap.NewFactory(resFact, transformer.NewFactoryImpl())
pc := konfig.DisabledPluginConfig()
kt := target.NewKustTarget(
loadertest.NewFakeLoaderWithRestrictor(
loader.RestrictionRootOnly, fSys, path),
loader.RestrictionRootOnly, fSys, root),
valtest_test.MakeFakeValidator(),
rf,
transformer.NewFactoryImpl(),