Documentation ¶
Index ¶
- type AssertFunc
- type Harness
- func (th Harness) AssertActualEqualsExpected(m resmap.ResMap, expected string)
- func (th Harness) AssertActualEqualsExpectedNoIdAnnotations(m resmap.ResMap, expected string)
- func (th Harness) AssertActualEqualsExpectedWithTweak(m resmap.ResMap, tweaker func([]byte) []byte, expected string)
- func (th Harness) GetFSys() filesys.FileSystem
- func (th Harness) GetT() *testing.T
- func (th Harness) MakeDefaultOptions() krusty.Options
- func (th Harness) MakeOptionsPluginsDisabled() krusty.Options
- func (th Harness) MakeOptionsPluginsEnabled() krusty.Options
- func (th Harness) Run(path string, o krusty.Options) resmap.ResMap
- func (th Harness) RunWithErr(path string, o krusty.Options) error
- func (th Harness) WriteC(path string, content string)
- func (th Harness) WriteF(path string, content string)
- func (th Harness) WriteK(path string, content string)
- func (th Harness) WriteLegacyConfigs(fName string)
- type HarnessEnhanced
- func (th *HarnessEnhanced) BuildGoPlugin(g, v, k string) *HarnessEnhanced
- func (th *HarnessEnhanced) ErrorFromLoadAndRunTransformer(config, input string) error
- func (th *HarnessEnhanced) LoadAndRunGenerator(config string) resmap.ResMap
- func (th *HarnessEnhanced) LoadAndRunTransformer(config, input string) resmap.ResMap
- func (th *HarnessEnhanced) PrepBuiltin(k string) *HarnessEnhanced
- func (th *HarnessEnhanced) PrepExecPlugin(g, v, k string) *HarnessEnhanced
- func (th *HarnessEnhanced) Reset()
- func (th *HarnessEnhanced) ResetLoaderRoot(root string)
- func (th *HarnessEnhanced) RunTransformer(config, input string) (resmap.ResMap, error)
- func (th *HarnessEnhanced) RunTransformerAndCheckError(config, input string, assertFn AssertFunc)
- func (th *HarnessEnhanced) RunTransformerAndCheckResult(config, input, expected string)
- func (th *HarnessEnhanced) RunTransformerFromResMap(config string, resMap resmap.ResMap) (resmap.ResMap, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertFunc ¶
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
Harness manages a test environment.
func MakeHarness ¶
func MakeHarnessWithFs ¶
func MakeHarnessWithFs( t *testing.T, fSys filesys.FileSystem) Harness
func (Harness) AssertActualEqualsExpected ¶
func (Harness) AssertActualEqualsExpectedNoIdAnnotations ¶
func (Harness) AssertActualEqualsExpectedWithTweak ¶
func (Harness) GetFSys ¶
func (th Harness) GetFSys() filesys.FileSystem
func (Harness) MakeDefaultOptions ¶
func (Harness) MakeOptionsPluginsDisabled ¶
This has no impact on Builtin plugins, as they are always enabled.
func (Harness) MakeOptionsPluginsEnabled ¶
Enables use of non-builtin plugins.
func (Harness) RunWithErr ¶
Run, failing if there is no error.
func (Harness) WriteLegacyConfigs ¶
type HarnessEnhanced ¶
type HarnessEnhanced struct { // An instance of *testing.T, and a filesystem (likely in-memory) // for loading test data - plugin config, resources to transform, etc. Harness // contains filtered or unexported fields }
HarnessEnhanced manages a full plugin environment for tests.
func MakeEnhancedHarness ¶
func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced
func (*HarnessEnhanced) BuildGoPlugin ¶
func (th *HarnessEnhanced) BuildGoPlugin(g, v, k string) *HarnessEnhanced
func (*HarnessEnhanced) ErrorFromLoadAndRunTransformer ¶
func (th *HarnessEnhanced) ErrorFromLoadAndRunTransformer( config, input string) error
func (*HarnessEnhanced) LoadAndRunGenerator ¶
func (th *HarnessEnhanced) LoadAndRunGenerator( config string) resmap.ResMap
func (*HarnessEnhanced) LoadAndRunTransformer ¶
func (th *HarnessEnhanced) LoadAndRunTransformer( config, input string) resmap.ResMap
func (*HarnessEnhanced) PrepBuiltin ¶
func (th *HarnessEnhanced) PrepBuiltin(k string) *HarnessEnhanced
func (*HarnessEnhanced) PrepExecPlugin ¶
func (th *HarnessEnhanced) PrepExecPlugin(g, v, k string) *HarnessEnhanced
func (*HarnessEnhanced) Reset ¶
func (th *HarnessEnhanced) Reset()
func (*HarnessEnhanced) ResetLoaderRoot ¶
func (th *HarnessEnhanced) ResetLoaderRoot(root string)
ResetLoaderRoot interprets its argument as an absolute directory path. It creates the directory, and creates the harness's file loader rooted in that directory.
func (*HarnessEnhanced) RunTransformer ¶
func (th *HarnessEnhanced) RunTransformer( config, input string) (resmap.ResMap, error)
func (*HarnessEnhanced) RunTransformerAndCheckError ¶
func (th *HarnessEnhanced) RunTransformerAndCheckError( config, input string, assertFn AssertFunc)
func (*HarnessEnhanced) RunTransformerAndCheckResult ¶
func (th *HarnessEnhanced) RunTransformerAndCheckResult( config, input, expected string)
func (*HarnessEnhanced) RunTransformerFromResMap ¶
Click to show internal directories.
Click to hide internal directories.