utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDevfileSamples added in v1.1.0

func CopyDevfileSamples(t *testing.T, testDevfiles []string)

CopyDevfileSamples : Copies existing artifacts from the devfiles/samples directory to the tmp/library_test directory. Used in parent tests

func RunMultiThreadTest

func RunMultiThreadTest(testContent commonUtils.TestContent, t *testing.T)

RunMultiThreadTest : Runs the same test on multiple threads, the test is based on the content of the specified TestContent

func RunMultiThreadedStaticTest added in v1.3.0

func RunMultiThreadedStaticTest(testContent commonUtils.TestContent, t *testing.T)

RunMultiThreadedStaticTest : Runs the same test on multiple threads, the test is based on the content of the specified TestContent

func RunStaticTest added in v1.3.0

func RunStaticTest(testContent commonUtils.TestContent, t *testing.T)

RunStaticTest : Runs fixed tests based on pre-existing artifacts

func RunTest

func RunTest(testContent commonUtils.TestContent, t *testing.T)

RunTest : Runs a test to create and verify a devfile based on the content of the specified TestContent

func SetParserArgs added in v1.1.0

func SetParserArgs(args parser.ParserArgs)

SetParserArgs : Used when parser args other than filename are set in the library tests

func UpdateCommand

func UpdateCommand(devfile *commonUtils.TestDevfile, commandId string) error

UpdateCommand randomly updates attribute values of a specified command in the devfile schema

func UpdateComponent

func UpdateComponent(devfile *commonUtils.TestDevfile, componentName string) error

UpdateComponent randomly updates the attribute values of a specified component

func UpdateProject

func UpdateProject(devfile *commonUtils.TestDevfile, projectName string) error

UpdateProject randomly modifies an existing project

func UpdateStarterProject

func UpdateStarterProject(devfile *commonUtils.TestDevfile, projectName string) error

UpdateStarterProject randomly modifies an existing starter project

func VerifyCommands

func VerifyCommands(devfile *commonUtils.TestDevfile, parserCommands []schema.Command) error

VerifyCommands verifies commands returned by the parser are the same as those saved in the devfile schema

func VerifyComponents

func VerifyComponents(devfile *commonUtils.TestDevfile, parserComponents []schema.Component) error

VerifyComponents verifies components returned by the parser are the same as those saved in the devfile schema

func VerifyProjects

func VerifyProjects(devfile *commonUtils.TestDevfile, parserProjects []schema.Project) error

VerifyProjects verifies projects returned by the parser are the same as those saved in the devfile schema

func VerifyStarterProjects

func VerifyStarterProjects(devfile *commonUtils.TestDevfile, parserStarterProjects []schema.StarterProject) error

VerifyStarterProjects verifies starter projects returned by the parser are the same as those saved in the devfile schema

Types

type DevfileFollower

type DevfileFollower struct {
	LibraryData devfileData.DevfileData
}

DevfileFollower struct for DevfileFollower interface. The DevfileFollower interface is defined in test/v200/utils/common/test_utils.go of the devfile/api repository

func (DevfileFollower) AddCommand

func (devfileFollower DevfileFollower) AddCommand(command schema.Command) error

AddCommand adds the specified command to the library data

func (DevfileFollower) AddComponent

func (devfileFollower DevfileFollower) AddComponent(component schema.Component) error

AddComponent adds the specified component to the library data

func (DevfileFollower) AddEvent

func (devfileFollower DevfileFollower) AddEvent(event schema.Events) error

AddEvent adds the specified event to the library data

func (DevfileFollower) AddProject

func (devfileFollower DevfileFollower) AddProject(project schema.Project) error

AddProject adds the specified project to the library data

func (DevfileFollower) AddStarterProject

func (devfileFollower DevfileFollower) AddStarterProject(starterProject schema.StarterProject) error

AddStarterProject adds the specified starter project to the library data

func (DevfileFollower) SetMetaData

func (devfileFollower DevfileFollower) SetMetaData(metaData header.DevfileMetadata) error

SetMetaData sets the specified metaData in the library data

func (DevfileFollower) SetParent

func (devfileFollower DevfileFollower) SetParent(parent schema.Parent) error

SetParent sets the specified parent in the library data

func (DevfileFollower) SetSchemaVersion

func (devfileFollower DevfileFollower) SetSchemaVersion(schemaVersion string)

SetSchemaVersion sets the specified schemaVersion in the library data

func (DevfileFollower) UpdateCommand

func (devfileFollower DevfileFollower) UpdateCommand(command schema.Command)

UpdateCommand updates the specified command in the library data

func (DevfileFollower) UpdateComponent

func (devfileFollower DevfileFollower) UpdateComponent(component schema.Component)

UpdateComponent updates the specified component in the library data

func (DevfileFollower) UpdateEvent

func (devfileFollower DevfileFollower) UpdateEvent(event schema.Events)

UpdateEvent updates the specified event in the library data

func (DevfileFollower) UpdateMetaData

func (devfileFollower DevfileFollower) UpdateMetaData(updateMetaData header.DevfileMetadata)

UpdateMetaData updates the specified UpdateMetaData in the library data

func (DevfileFollower) UpdateParent

func (devfileFollower DevfileFollower) UpdateParent(parent schema.Parent)

UpdateParent updates the specified parent in the library data

func (DevfileFollower) UpdateProject

func (devfileFollower DevfileFollower) UpdateProject(project schema.Project)

UpdateProject updates the specified project in the library data

func (DevfileFollower) UpdateStarterProject

func (devfileFollower DevfileFollower) UpdateStarterProject(starterProject schema.StarterProject)

UpdateStarterProject updates the specified starter project in the library data

type DevfileValidator

type DevfileValidator struct{}

DevfileValidator struct for DevfileValidator interface. The DevfileValidator interface is test/v200/utils/common/test_utils.go of the devfile/api repository.

func (DevfileValidator) WriteAndValidate

func (devfileValidator DevfileValidator) WriteAndValidate(devfile *commonUtils.TestDevfile) error

WriteAndValidate implements DevfileValidator interface. writes to disk and validates the specified devfile

Jump to

Keyboard shortcuts

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