MCPcopy Index your code
hub / github.com/devfile/api / AddCommand

Method AddCommand

test/v200/utils/common/command_test_utils.go:85–100  ·  view source on GitHub ↗

AddCommand creates a command of a specified type in a schema structure and pupulates it with random attributes

(commandType schema.CommandType)

Source from the content-addressed store, hash-verified

83
84// AddCommand creates a command of a specified type in a schema structure and pupulates it with random attributes
85func (testDevFile *TestDevfile) AddCommand(commandType schema.CommandType) schema.Command {
86
87 var command *schema.Command
88 switch commandType {
89 case schema.ExecCommandType:
90 command = testDevFile.createExecCommand()
91 testDevFile.SetExecCommandValues(command)
92 case schema.CompositeCommandType:
93 command = testDevFile.createCompositeCommand()
94 testDevFile.SetCompositeCommandValues(command)
95 case schema.ApplyCommandType:
96 command = testDevFile.createApplyCommand()
97 testDevFile.SetApplyCommandValues(command)
98 }
99 return *command
100}
101
102// createExecCommand creates and returns an empty exec command in a schema structure
103func (testDevFile *TestDevfile) createExecCommand() *schema.Command {

Callers 4

RunTestMethod · 0.95
SetEventsValuesMethod · 0.95

Calls 6

createExecCommandMethod · 0.95
SetExecCommandValuesMethod · 0.95
createApplyCommandMethod · 0.95
SetApplyCommandValuesMethod · 0.95

Tested by

no test coverage detected