MCPcopy Create free account
hub / github.com/devfile/api / addGroup

Method addGroup

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

addGroup creates and returns a group in a schema structure

()

Source from the content-addressed store, hash-verified

66
67// addGroup creates and returns a group in a schema structure
68func (testDevFile *TestDevfile) addGroup() *schema.CommandGroup {
69
70 commandGroup := schema.CommandGroup{}
71 commandGroup.Kind = schema.CommandGroupKind(GetRandomValue(GroupKinds).String())
72 LogInfoMessage(fmt.Sprintf("group Kind: %s, default already set %t", commandGroup.Kind, testDevFile.GroupDefaults[commandGroup.Kind]))
73 // Ensure only one and at least one of each type are labelled as default
74 if !testDevFile.GroupDefaults[commandGroup.Kind] {
75 testDevFile.GroupDefaults[commandGroup.Kind] = true
76 commandGroup.IsDefault = &isTrue
77 } else {
78 commandGroup.IsDefault = &isFalse
79 }
80 LogInfoMessage(fmt.Sprintf("group isDefault: %t", *commandGroup.IsDefault))
81 return &commandGroup
82}
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 {

Callers 3

SetExecCommandValuesMethod · 0.95
SetApplyCommandValuesMethod · 0.95

Calls 2

GetRandomValueFunction · 0.85
LogInfoMessageFunction · 0.85

Tested by

no test coverage detected