@@ -51,7 +51,6 @@ Each test in ```parser_v200_verify_test.go``` sets values in a test structure wh
51
51
CommandTypes []schema.CommandType
52
52
ComponentTypes []schema.ComponentType
53
53
FileName string
54
- CreateWithParser bool
55
54
EditContent bool
56
55
}
57
56
@@ -68,7 +67,6 @@ An example test:
68
67
func Test_MultiCommand(t *testing.T) {
69
68
testContent := TestContent{}
70
69
testContent.CommandTypes = []schema.CommandType{schema.ExecCommandType, schema.CompositeCommandType}
71
- testContent.CreateWithParser = true
72
70
testContent.EditContent = true
73
71
testContent.FileName = GetDevFileName()
74
72
runTest(testContent, t)
@@ -128,14 +126,14 @@ For example add support for apply command to existing command support:
128
126
129
127
1 . In ``` command-test-utils.go ```
130
128
* add functions:
131
- * ``` func setApplyCommandValues(applyCommand *schema.ApplyCommand ) ```
132
- * randomly set attribute values in the provided apply command object
133
- * ``` func createApplyCommand() *schema.ApplyCommand ```
134
- * creates the apply command object and calls setApplyCommandValues to add attribute values
129
+ * ``` func (devfile *TestDevfile) setApplyCommandValues(applyCommand *schema.Command ) ```
130
+ * randomly sets attribute values in the provided apply command object
131
+ * ``` func (devfile *TestDevfile) createApplyCommand() *schema.ApplyCommand ```
132
+ * creates an empty apply command object and adds it to parser and test schema data
135
133
* follow the implementation of other similar functions.
136
134
* modify:
137
- * ``` func generateCommand(command *schema.Command, genericCommand *GenericCommand) ```
138
- * add logic to call createApplyCommand if commandType indicates such.
135
+ * ``` func (devfile *TestDevfile) AddCommand(commandType schema.CommandType) schema.Command ```
136
+ * add logic to call createApplyCommand if commandType indicates such and call setApplyCommandValues
139
137
* ``` func (devfile *TestDevfile) UpdateCommand(command *schema.Command) error ```
140
138
* add logic to call setApplyCommandValues if commandType indicates such.
141
139
1 . In ``` parser_v200_verify_test.go ```
@@ -156,24 +154,21 @@ Using existing support for commands as an illustration, any new property support
156
154
* Specific to commands
157
155
* Commands require support for 5 different command types:
158
156
* Exec
159
- * Appy (to be implemented)
157
+ * Apply (to be implemented)
160
158
* Composite
161
159
* VSCodeLaunch (to be implemented)
162
160
* VSCodeTask (to be implemented)
163
161
* Each of these command-types have equivalent functions:
164
- * ``` func create<command-type>Command() *schema.<command-type> ```
162
+ * ``` func (devfile *TestDevfile) create<command-type>Command() *schema.Command ```
165
163
* creates the command object and calls ``` set<command-type>CommandValues ``` to add attribute values
166
- * for example see: ``` func createExecCommand(execCommand *schema.ExecCommand) ```
167
- * ``` func set<command-type>CommandValues(project-sourceProject *schema.<project-source> ) ```
164
+ * for example see: ``` func (devfile *TestDevfile) createExecCommand() *schema.Command ```
165
+ * ``` func (devfile *TestDevfile) set<command-type>CommandValues(command *schema.Command ) ```
168
166
* sets random attributes into the provided object
169
- * for example see: ``` func setExecCommandValues(execCommand *schema.ExecCommand ) ```
167
+ * for example see: ``` func (devfile *TestDevfile) setExecCommandValues(ommand *schema.Command ) ```
170
168
* Functions general to all commands
171
- * ``` func generateCommand(command *schema.Command, genericCommand *GenericCommand) ```
169
+ * ``` func addCommand( genericCommand *GenericCommand) schema.Command ```
172
170
* includes logic to call the ``` create<Command-Type>Command ``` function for the command-Type of the supplied command object.
173
- * ``` func (devfile *TestDevfile) addCommand(commandType schema.CommandType) string ```
174
171
* main entry point for a test to add a command
175
- * maintains the array of commands in the schema structure
176
- * calls generateCommand()
177
172
* ``` func (devfile *TestDevfile) UpdateCommand(command *schema.Command) error ```
178
173
* includes logic to call set<commad-type >CommandValues for each commandType.
179
174
* ``` func (devfile TestDevfile) VerifyCommands(parserCommands []schema.Command) error ```
@@ -218,10 +213,9 @@ Create, modify and verify an exec command:
218
213
1 . parser_v200_verify_test.Test_ExecCommand
219
214
1 . parser-v200-test.runTest
220
215
1 . command-test-utils.AddCommand
221
- 1 . command-test-utils.GenerateCommand
222
- 1. command-test-utils.createExecCommand
223
- 1. command-test-utils.setExecCommandValues
224
- 1 . test-utils.CreateDevfile
216
+ 1 . command-test-utils.createExecCommand
217
+ 1 . command-test-utils.setExecCommandValues
218
+ 1 . test-utils.WriteDevfile
225
219
1 . test-utils.EditCommands
226
220
1 . command-test-utils.UpdateCommand
227
221
1 . command-test-utils.setExecCommandValues
0 commit comments