testingutil

package
v1.0.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFakeContainer

func CreateFakeContainer(containerName string) corev1.Container

CreateFakeContainer creates a container with the given containerName

func FakeResourceRequirements

func FakeResourceRequirements(cpu, memory string) (corev1.ResourceRequirements, error)

FakeResourceRequirements creates a fake resource requirements from cpu and memory

func GetFakeContainerComponent

func GetFakeContainerComponent(name string) v1.Component

GetFakeContainerComponent returns a fake container component for testing.

func GetFakeEnv

func GetFakeEnv(name, value string) v1.EnvVar

GetFakeEnv returns a fake env for testing

func GetFakeEnvParentOverride

func GetFakeEnvParentOverride(name, value string) v1.EnvVarParentOverride

GetFakeEnvParentOverride returns a fake envParentOverride for testing

func GetFakeExecRunCommands

func GetFakeExecRunCommands() []v1.ExecCommand

GetFakeExecRunCommands returns fake commands for testing

func GetFakeVolumeComponent

func GetFakeVolumeComponent(name, size string) v1.Component

GetFakeVolumeComponent returns a fake volume component for testing

func GetFakeVolumeMount

func GetFakeVolumeMount(name, path string) v1.VolumeMount

GetFakeVolumeMount returns a fake volume mount for testing

func GetFakeVolumeMountParentOverride

func GetFakeVolumeMountParentOverride(name, path string) v1.VolumeMountParentOverride

GetFakeVolumeMountParentOverride returns a fake volumeMountParentOverride for testing

Types

type TestDevfileData

type TestDevfileData struct {
	Components        []v1.Component
	ExecCommands      []v1.ExecCommand
	CompositeCommands []v1.CompositeCommand
	Commands          []v1.Command
	Events            v1.Events
}

TestDevfileData is a convenience data type used to mock up a devfile configuration

func (*TestDevfileData) AddCommands

func (d *TestDevfileData) AddCommands(commands ...v1.Command) error

AddCommands is a mock func that adds commands to the test devfile

func (TestDevfileData) AddComponents

func (d TestDevfileData) AddComponents(components []v1.Component) error

AddComponents is a mock function to add components to the test devfile

func (TestDevfileData) AddEvents

func (d TestDevfileData) AddEvents(events v1.Events) error

AddEvents is a mock function to add events to the test devfile

func (TestDevfileData) AddProjects

func (d TestDevfileData) AddProjects(projects []v1.Project) error

AddProjects is a mock function to add projects to the test devfile

func (TestDevfileData) AddStarterProjects

func (d TestDevfileData) AddStarterProjects(projects []v1.StarterProject) error

AddStarterProjects is a mock func to add the starter projects to the test devfile

func (TestDevfileData) AddVolume

func (d TestDevfileData) AddVolume(volumeComponent v1.Component, path string) error

AddVolume is a mock func that adds volume to the test devfile

func (TestDevfileData) DeleteVolume

func (d TestDevfileData) DeleteVolume(name string) error

DeleteVolume is a mock func that deletes volume from the test devfile

func (TestDevfileData) GetCommands

func (d TestDevfileData) GetCommands(options common.DevfileOptions) ([]v1.Command, error)

GetCommands is a mock function to get the commands from a devfile

func (TestDevfileData) GetComponents

func (d TestDevfileData) GetComponents(options common.DevfileOptions) ([]v1.Component, error)

GetComponents is a mock function to get the components from a devfile

func (TestDevfileData) GetDevfileContainerComponents

func (d TestDevfileData) GetDevfileContainerComponents(options common.DevfileOptions) ([]v1.Component, error)

GetDevfileContainerComponents gets the container components from the test devfile

func (TestDevfileData) GetDevfileVolumeComponents

func (d TestDevfileData) GetDevfileVolumeComponents(options common.DevfileOptions) ([]v1.Component, error)

GetDevfileVolumeComponents gets the volume components from the test devfile

func (TestDevfileData) GetDevfileWorkspace

func (d TestDevfileData) GetDevfileWorkspace() *v1.DevWorkspaceTemplateSpecContent

GetDevfileWorkspace is a mock func to get the DevfileWorkspace in a test devfile

func (TestDevfileData) GetEvents

func (d TestDevfileData) GetEvents() v1.Events

GetEvents is a mock function to get events from devfile

func (TestDevfileData) GetMetadata

func (d TestDevfileData) GetMetadata() devfilepkg.DevfileMetadata

GetMetadata is a mock function to get metadata from devfile

func (TestDevfileData) GetParent

func (d TestDevfileData) GetParent() *v1.Parent

GetParent is a mock function to get parent from devfile

func (TestDevfileData) GetProjects

func (d TestDevfileData) GetProjects(options common.DevfileOptions) ([]v1.Project, error)

GetProjects is a mock function to get the projects from a test devfile

func (TestDevfileData) GetSchemaVersion

func (d TestDevfileData) GetSchemaVersion() string

GetSchemaVersion gets the schema version for the test devfile

func (TestDevfileData) GetStarterProjects

func (d TestDevfileData) GetStarterProjects(options common.DevfileOptions) ([]v1.StarterProject, error)

GetStarterProjects is a mock function to get the starter projects from a test devfile

func (TestDevfileData) GetVolumeMountPath

func (d TestDevfileData) GetVolumeMountPath(name string) (string, error)

GetVolumeMountPath is a mock func that gets the volume mount path of a container

func (TestDevfileData) SetDevfileWorkspace

func (d TestDevfileData) SetDevfileWorkspace(content v1.DevWorkspaceTemplateSpecContent)

SetDevfileWorkspace is a mock func to set the DevfileWorkspace in a test devfile

func (TestDevfileData) SetMetadata

func (d TestDevfileData) SetMetadata(name, version string)

SetMetadata sets metadata for the test devfile

func (TestDevfileData) SetParent

func (d TestDevfileData) SetParent(parent *v1.Parent)

SetParent is a mock function to set parent of the test devfile

func (TestDevfileData) SetSchemaVersion

func (d TestDevfileData) SetSchemaVersion(version string)

SetSchemaVersion sets the schema version for the test devfile

func (TestDevfileData) UpdateCommand

func (d TestDevfileData) UpdateCommand(command v1.Command)

UpdateCommand is a mock func to update the command in a test devfile

func (TestDevfileData) UpdateComponent

func (d TestDevfileData) UpdateComponent(component v1.Component)

UpdateComponent is a mock function to update the component of the test devfile

func (TestDevfileData) UpdateEvents

func (d TestDevfileData) UpdateEvents(postStart, postStop, preStart, preStop []string)

UpdateEvents is a mock function to update the events of the test devfile

func (TestDevfileData) UpdateProject

func (d TestDevfileData) UpdateProject(project v1.Project)

UpdateProject is a mock function to update a project for the test devfile

func (TestDevfileData) UpdateStarterProject

func (d TestDevfileData) UpdateStarterProject(project v1.StarterProject)

UpdateStarterProject is a mock func to update the starter project for a test devfile

func (TestDevfileData) Validate

func (d TestDevfileData) Validate() error

Validate is a mock validation that always validates without error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL