Documentation ¶
Index ¶
- func CleanupEnv(confFiles []*os.File, t *testing.T)
- func CreateFakeDeployment(podName string) *appsv1.Deployment
- func CreateFakePod(componentName, podName string) *corev1.Pod
- func FakeClusterServiceClass(name string, tags ...string) v1beta1.ClusterServiceClass
- func FakeClusterServicePlan(name string, planNumber int) v1beta1.ClusterServicePlan
- func FakeDeploymentConfigs() *v1.DeploymentConfigList
- func FakeImageStreamTags(imageName string, namespace string, tags []string, hiddenTags []string) *imagev1.ImageStreamTagList
- func FakeImageStreams(imageName string, namespace string, tags []string) *imagev1.ImageStreamList
- func FakeKubeClientConfig() string
- func FakeNamespaceStatus(status corev1.NamespacePhase, name string) *corev1.Namespace
- func FakeNamespaces() *corev1.NamespaceList
- func FakeOdoConfig(confPath string, needNamePrefix bool, namePrefix string) preference.PreferenceInfo
- func FakeOnlyOneExistingNamespace() *corev1.NamespaceList
- func FakeOnlyOneExistingProjects() *v1.ProjectList
- func FakePVC(pvcName, size string, labels map[string]string) *corev1.PersistentVolumeClaim
- func FakePlanInstanceCreateParameterSchemasRaw() [][]byte
- func FakePortListener(startedChan chan<- bool, stopChan <-chan bool, localPort int) error
- func FakeProjectStatus(prjStatus corev1.NamespacePhase, prjName string) *projectv1.Project
- func FakeProjects() *v1.ProjectList
- func FakeRemoveProject(project string, projects *v1.ProjectList) *v1.ProjectList
- func FakeServiceClassInstance(serviceInstanceName string, serviceClassName string, planName string, ...) scv1beta1.ServiceInstance
- func GetFakeContainerComponent(name string) versionsCommon.DevfileComponent
- func GetFakeEnv(name, value string) versionsCommon.Env
- func GetFakeExecRunCommands() []versionsCommon.Exec
- func GetFakeVolumeComponent(name string) versionsCommon.DevfileComponent
- func GetFakeVolumeMount(name, path string) versionsCommon.VolumeMount
- func GetRouteListWithMultiple(componentName, applicationName string) *routev1.RouteList
- func GetSingleRoute(urlName string, port int, componentName, applicationName string) routev1.Route
- func MkFileWithContent(path, content string, fs filesystem.Filesystem) (string, error)
- func OneFakeDeploymentConfigWithMounts(componentName, componentType, applicationName string, ...) *v1.DeploymentConfig
- func RunPromptTest(t *testing.T, test PromptTest)
- func RunTest(t *testing.T, procedure func(*expect.Console), test func(terminal.Stdio) error)
- func SetUp(odoConfigDetails ConfigDetails, kubeConfigDetails ConfigDetails) (*os.File, *os.File, error)
- func SimulateFileModifications(basePath string, fileModification FileProperties) (string, error)
- func SingleValuedRawExtension(name, value string) *runtime.RawExtension
- func Stdio(c *expect.Console) terminal.Stdio
- func TempMkFile(dir string, fileName string) (string, error)
- func TempMkdir(parentDir string, newDirPrefix string) (string, error)
- type ConfigDetails
- type FileProperties
- type FileType
- type M
- type ModificationType
- type PromptTest
- type TestDevfileData
- func (d TestDevfileData) AddCommands(commands []common.DevfileCommand) error
- func (d TestDevfileData) AddComponents(components []common.DevfileComponent) error
- func (d TestDevfileData) AddEvents(events common.DevfileEvents) error
- func (d TestDevfileData) AddProjects(projects []common.DevfileProject) error
- func (d TestDevfileData) GetAliasedComponents() []versionsCommon.DevfileComponent
- func (d TestDevfileData) GetCommands() []versionsCommon.DevfileCommand
- func (d TestDevfileData) GetComponents() []versionsCommon.DevfileComponent
- func (d TestDevfileData) GetEvents() versionsCommon.DevfileEvents
- func (d TestDevfileData) GetMetadata() versionsCommon.DevfileMetadata
- func (d TestDevfileData) GetParent() versionsCommon.DevfileParent
- func (d TestDevfileData) GetProjects() []versionsCommon.DevfileProject
- func (d TestDevfileData) SetEvents(events common.DevfileEvents)
- func (d TestDevfileData) SetMetadata(name, version string)
- func (d TestDevfileData) SetParent(parent common.DevfileParent)
- func (d TestDevfileData) SetSchemaVersion(version string)
- func (d TestDevfileData) UpdateCommand(command common.DevfileCommand)
- func (d TestDevfileData) UpdateComponent(component common.DevfileComponent)
- func (d TestDevfileData) UpdateEvents(postStart, postStop, preStart, preStop []string)
- func (d TestDevfileData) UpdateProject(project common.DevfileProject)
- func (d TestDevfileData) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupEnv ¶ added in v0.0.14
CleanupEnv cleans up the mock config file and anything that SetupEnv generated Parameters:
configFile: the mock config file handler t: testing pointer to log errors if any
func CreateFakeDeployment ¶ added in v1.1.2
func CreateFakeDeployment(podName string) *appsv1.Deployment
CreateFakeDeployment creates a fake deployment with the given pod name and labels
func CreateFakePod ¶ added in v1.2.6
CreateFakePod creates a fake pod with the given pod name and component name
func FakeClusterServiceClass ¶ added in v0.0.18
func FakeClusterServiceClass(name string, tags ...string) v1beta1.ClusterServiceClass
FakeClusterServiceClass creates a fake service class with the specified name for testing purposes
func FakeClusterServicePlan ¶ added in v0.0.18
func FakeClusterServicePlan(name string, planNumber int) v1beta1.ClusterServicePlan
FakeClusterServicePlan creates a fake plan with the specified external name and using planNumber to customize description, metadata and parameter values
func FakeDeploymentConfigs ¶ added in v0.0.10
func FakeDeploymentConfigs() *v1.DeploymentConfigList
func FakeImageStreamTags ¶ added in v0.0.19
func FakeImageStreamTags(imageName string, namespace string, tags []string, hiddenTags []string) *imagev1.ImageStreamTagList
FakeImageStreamTags lists the imagestreams for the reactor
func FakeImageStreams ¶
func FakeImageStreams(imageName string, namespace string, tags []string) *imagev1.ImageStreamList
FakeImageStreams lists the imagestreams for the reactor
func FakeKubeClientConfig ¶ added in v0.0.14
func FakeKubeClientConfig() string
FakeKubeClientConfig returns mock kube client config
func FakeNamespaceStatus ¶ added in v1.2.6
func FakeNamespaceStatus(status corev1.NamespacePhase, name string) *corev1.Namespace
FakeNamespaceStatus returns fake namespace status for use by mock watch on namespace
func FakeNamespaces ¶ added in v1.2.6
func FakeNamespaces() *corev1.NamespaceList
FakeNamespaces returns fake namespace list for use by API mock functions for Unit tests
func FakeOdoConfig ¶ added in v0.0.14
func FakeOdoConfig(confPath string, needNamePrefix bool, namePrefix string) preference.PreferenceInfo
FakeOdoConfig returns mock odo config It takes a confPath which is the path to the config
func FakeOnlyOneExistingNamespace ¶ added in v1.2.6
func FakeOnlyOneExistingNamespace() *corev1.NamespaceList
FakeOnlyOneExistingNamespace similar as FakeOnlyOneExistingProjects only with Namespace
func FakeOnlyOneExistingProjects ¶ added in v0.0.14
func FakeOnlyOneExistingProjects() *v1.ProjectList
FakeOnlyOneExistingProjects returns fake projectlist with single project for use by API mock functions for Unit tests testing delete of the only available project
func FakePVC ¶ added in v1.0.0
func FakePVC(pvcName, size string, labels map[string]string) *corev1.PersistentVolumeClaim
func FakePlanInstanceCreateParameterSchemasRaw ¶ added in v1.1.1
func FakePlanInstanceCreateParameterSchemasRaw() [][]byte
FakePlanInstanceCreateParameterSchemasRaw creates 2 create parameter schemas for testing purposes
func FakePortListener ¶ added in v1.1.1
FakePortListener starts a fake test server and listens on the given localPort
func FakeProjectStatus ¶ added in v0.0.14
func FakeProjectStatus(prjStatus corev1.NamespacePhase, prjName string) *projectv1.Project
FakeProjectStatus returns fake project status for use by mock watch on project
func FakeProjects ¶ added in v0.0.11
func FakeProjects() *v1.ProjectList
FakeProjects returns fake projectlist for use by API mock functions for Unit tests
func FakeRemoveProject ¶ added in v0.0.14
func FakeRemoveProject(project string, projects *v1.ProjectList) *v1.ProjectList
FakeRemoveProject removes the delete requested project from the list of projects passed
func FakeServiceClassInstance ¶ added in v0.0.18
func FakeServiceClassInstance(serviceInstanceName string, serviceClassName string, planName string, status string) scv1beta1.ServiceInstance
FakeServiceClassInstance creates and returns a simple service class instance for testing purpose serviceInstanceName is the name of the service class instance serviceClassName is the name of the service class planName is the name of the plan status is the status of the service instance
func GetFakeContainerComponent ¶ added in v1.2.5
func GetFakeContainerComponent(name string) versionsCommon.DevfileComponent
GetFakeContainerComponent returns a fake container component for testing
func GetFakeEnv ¶ added in v1.2.5
func GetFakeEnv(name, value string) versionsCommon.Env
GetFakeExecRunCommands returns a fake env for testing
func GetFakeExecRunCommands ¶ added in v1.2.2
func GetFakeExecRunCommands() []versionsCommon.Exec
GetFakeExecRunCommands returns fake commands for testing
func GetFakeVolumeComponent ¶ added in v1.2.5
func GetFakeVolumeComponent(name string) versionsCommon.DevfileComponent
GetFakeVolumeComponent returns a fake volume component for testing
func GetFakeVolumeMount ¶ added in v1.2.5
func GetFakeVolumeMount(name, path string) versionsCommon.VolumeMount
GetFakeVolumeMount returns a fake volume mount for testing
func GetRouteListWithMultiple ¶ added in v1.2.1
func GetSingleRoute ¶ added in v1.2.1
func MkFileWithContent ¶ added in v1.1.1
func MkFileWithContent(path, content string, fs filesystem.Filesystem) (string, error)
func OneFakeDeploymentConfigWithMounts ¶ added in v1.0.0
func OneFakeDeploymentConfigWithMounts(componentName, componentType, applicationName string, mountedStorage map[string]*corev1.PersistentVolumeClaim) *v1.DeploymentConfig
mountedStorage is the map of the storage to be mounted key is the path for the mount, value is the pvc
func RunPromptTest ¶ added in v0.0.18
func RunPromptTest(t *testing.T, test PromptTest)
RunPromptTest runs the specified PromptTest in the given testing context
func RunTest ¶ added in v0.0.18
RunTest runs the given test using the specified procedure simulating the user interaction with the console
func SetUp ¶ added in v0.0.14
func SetUp(odoConfigDetails ConfigDetails, kubeConfigDetails ConfigDetails) (*os.File, *os.File, error)
SetUp sets up the odo and kube config files and returns respective conf file pointers and error
func SimulateFileModifications ¶ added in v0.0.15
func SimulateFileModifications(basePath string, fileModification FileProperties) (string, error)
SimulateFileModifications mock function to simulate requested file/folder operation Parameters:
basePath: The parent directory for file/folder involved in desired file operation fileModification: Meta-data of file/folder
Returns:
path to file/folder involved in the operation error if any or nil
func SingleValuedRawExtension ¶ added in v0.0.18
func SingleValuedRawExtension(name, value string) *runtime.RawExtension
SingleValuedRawExtension creates a simple, single valued (name=value), raw extension
func TempMkFile ¶ added in v0.0.15
TempMkFile creates a temporary file.
Types ¶
type ConfigDetails ¶ added in v0.0.14
ConfigDetails struct holds configuration details(odo and/or kube config)
type FileProperties ¶ added in v0.0.15
type FileProperties struct { FilePath string FileParent string FileType FileType ModificationType ModificationType }
FileProperties to contain meta-data of a file like, file/folder name, file/folder parent dir, file type and desired file modification type
type ModificationType ¶ added in v0.0.15
type ModificationType string
ModificationType custom type to indicate file modification type
const ( // UPDATE enum representing update operation on a file UPDATE ModificationType = "update" // CREATE enum representing create operation for a file/folder CREATE ModificationType = "create" // DELETE enum representing delete operation for a file/folder DELETE ModificationType = "delete" // APPEND enum representing append operation on a file APPEND ModificationType = "append" )
type PromptTest ¶ added in v0.0.18
type PromptTest struct { // Name of the test Name string // Prompt to test Prompt survey.Prompt // Procedure defines the list of interaction with the console simulating user actions Procedure func(*expect.Console) // Expected result Expected interface{} }
PromptTest encapsulates a survey prompt test
type TestDevfileData ¶ added in v1.1.1
type TestDevfileData struct { Components []versionsCommon.DevfileComponent ExecCommands []versionsCommon.Exec CompositeCommands []versionsCommon.Composite Commands []versionsCommon.DevfileCommand Events common.DevfileEvents }
TestDevfileData is a convenience data type used to mock up a devfile configuration
func (TestDevfileData) AddCommands ¶ added in v1.2.5
func (d TestDevfileData) AddCommands(commands []common.DevfileCommand) error
func (TestDevfileData) AddComponents ¶ added in v1.2.5
func (d TestDevfileData) AddComponents(components []common.DevfileComponent) error
func (TestDevfileData) AddEvents ¶ added in v1.2.5
func (d TestDevfileData) AddEvents(events common.DevfileEvents) error
func (TestDevfileData) AddProjects ¶ added in v1.2.5
func (d TestDevfileData) AddProjects(projects []common.DevfileProject) error
func (TestDevfileData) GetAliasedComponents ¶ added in v1.1.1
func (d TestDevfileData) GetAliasedComponents() []versionsCommon.DevfileComponent
GetAliasedComponents is a mock function to get the components that have an alias from a devfile
func (TestDevfileData) GetCommands ¶ added in v1.1.2
func (d TestDevfileData) GetCommands() []versionsCommon.DevfileCommand
GetCommands is a mock function to get the commands from a devfile
func (TestDevfileData) GetComponents ¶ added in v1.1.1
func (d TestDevfileData) GetComponents() []versionsCommon.DevfileComponent
GetComponents is a mock function to get the components from a devfile
func (TestDevfileData) GetEvents ¶ added in v1.2.2
func (d TestDevfileData) GetEvents() versionsCommon.DevfileEvents
GetEvents is a mock function to get events from devfile
func (TestDevfileData) GetMetadata ¶ added in v1.2.2
func (d TestDevfileData) GetMetadata() versionsCommon.DevfileMetadata
GetMetadata is a mock function to get metadata from devfile
func (TestDevfileData) GetParent ¶ added in v1.2.2
func (d TestDevfileData) GetParent() versionsCommon.DevfileParent
GetParent is a mock function to get parent from devfile
func (TestDevfileData) GetProjects ¶ added in v1.1.2
func (d TestDevfileData) GetProjects() []versionsCommon.DevfileProject
GetProjects is a mock function to get the components that have an alias from a devfile
func (TestDevfileData) SetEvents ¶ added in v1.2.5
func (d TestDevfileData) SetEvents(events common.DevfileEvents)
func (TestDevfileData) SetMetadata ¶ added in v1.2.5
func (d TestDevfileData) SetMetadata(name, version string)
SetMetadata sets metadata for devfile
func (TestDevfileData) SetParent ¶ added in v1.2.5
func (d TestDevfileData) SetParent(parent common.DevfileParent)
func (TestDevfileData) SetSchemaVersion ¶ added in v1.2.5
func (d TestDevfileData) SetSchemaVersion(version string)
SetSchemaVersion sets schema version for devfile
func (TestDevfileData) UpdateCommand ¶ added in v1.2.5
func (d TestDevfileData) UpdateCommand(command common.DevfileCommand)
func (TestDevfileData) UpdateComponent ¶ added in v1.2.5
func (d TestDevfileData) UpdateComponent(component common.DevfileComponent)
func (TestDevfileData) UpdateEvents ¶ added in v1.2.5
func (d TestDevfileData) UpdateEvents(postStart, postStop, preStart, preStop []string)
func (TestDevfileData) UpdateProject ¶ added in v1.2.5
func (d TestDevfileData) UpdateProject(project common.DevfileProject)
func (TestDevfileData) Validate ¶ added in v1.1.1
func (d TestDevfileData) Validate() error
Validate is a mock validation that always validates without error