@@ -34,20 +34,27 @@ function usage(){
34
34
printf " \nOptions:"
35
35
printf " \n"
36
36
printf " \n-h | --help\n\tPrint the usage of this script."
37
- printf " \n-on or --ope_name {NAME}\n\tOperator image name."
38
- printf " \n-ot or --ope_tag {TAG}\n\tOperator image tag."
39
- printf " \n-mm or --maven_mirror {URI}\n\tMaven mirror url to be used when building app in the tests."
40
- printf " \n-f or --feature {FEATURE_NAME}\n\tRun a specific feature file."
41
- printf " \n-l or --local ${BOOLEAN} \n\tSpecify whether you run test in local"
42
- printf " \n-c or --concurrent ${NUMBER} \n\tSet the number of concurrent tests. Default is 1."
43
- printf " \n--build_image_version \n\tSet the image version. Default to current operator version"
44
- printf " \n-t or --tags ${tags} \n\tFilter scenarios by tags."
37
+ printf " \n--tags {TAGS}\n\tFilter scenarios by tags."
45
38
printf " \n\tExpressions can be:"
46
39
printf " \n\t\t- '@wip': run all scenarios with wip tag"
47
40
printf " \n\t\t- '~@wip': exclude all scenarios with wip tag"
48
41
printf " \n\t\t- '@wip && ~@new': run wip scenarios, but exclude new"
49
42
printf " \n\t\t- '@wip,@undone': run wip or undone scenarios"
50
43
printf " \n\t Scenarios with '@disabled' tag are always ignored."
44
+ printf " \n--concurrent {NUMBER}\n\tSet the number of concurrent tests. Default is 1."
45
+ printf " \n--feature {FEATURE_PATH}\n\tRun a specific feature file."
46
+ printf " \n--local {BOOLEAN}\n\tSpecify whether you run test in local."
47
+ printf " \n--operator_image {NAME}\n\tOperator image name. Default is 'quay.io/kiegroup' one."
48
+ printf " \n--operator_tag {TAG}\n\tOperator image tag. Default is operator version."
49
+ printf " \n--cli_path {PATH}\n\tPath to built CLI to test. Default is local built one."
50
+ printf " \n--deploy_uri {URI}\n\tUrl or Path to operator 'deploy' folder. Default is local 'deploy/' folder."
51
+ printf " \n--maven_mirror {URI}\n\tMaven mirror url to be used when building app in the tests."
52
+ printf " \n--build_image_version\n\tSet the image version. Default to current operator version"
53
+ printf " \n--build_image_tag\n\tSet the build image full tag."
54
+ printf " \n--build_s2i_image_tag \n\tSet the S2I build image full tag."
55
+ printf " \n--build_runtime_image_tag \n\tSet the Runtime build image full tag."
56
+ printf " \n--examples_uri ${URI} \n\tSet the URI for the kogito-examples repository. Default is https://github.com/kiegroup/kogito-examples."
57
+ printf " \n--examples_ref ${REF} \n\tSet the branch for the kogito-examples repository. Default is none."
51
58
printf " \n"
52
59
}
53
60
@@ -83,11 +90,50 @@ function delete_and_apply_crds(){
83
90
FEATURE=" "
84
91
CONCURRENT=1
85
92
TAGS=" "
93
+ DRY_RUN=
86
94
87
95
while (( $# ))
88
96
do
89
97
case $1 in
90
- -on|--ope_name)
98
+ --tags)
99
+ shift
100
+ if [[ ! ${1} =~ ^-.* ]]; then
101
+ if [[ ! -z " ${1} " ]]; then
102
+ TAGS=" ${1} " ;
103
+ fi ;
104
+ shift ;
105
+ fi
106
+ ;;
107
+ --concurrent)
108
+ shift
109
+ if [[ ! ${1} =~ ^-.* ]]; then
110
+ if [[ ! -z " ${1} " ]]; then
111
+ CONCURRENT=" ${1} " ;
112
+ fi ;
113
+ shift ;
114
+ fi
115
+ ;;
116
+ --feature)
117
+ shift
118
+ if [[ ! ${1} =~ ^-.* ]]; then
119
+ if [[ ! -z " ${1} " ]]; then
120
+ FEATURE=" ${1} " ;
121
+ fi ;
122
+ shift ;
123
+ fi
124
+ ;;
125
+ --local)
126
+ shift
127
+ if [[ ! ${1} =~ ^-.* ]]; then
128
+ if [[ ! -z " ${1} " ]]; then
129
+ if [ " ${1} " = " true" ]; then
130
+ export LOCAL_TESTS=true;
131
+ fi
132
+ fi ;
133
+ shift ;
134
+ fi
135
+ ;;
136
+ --operator_image)
91
137
shift
92
138
if [[ ! ${1} =~ ^-.* ]]; then
93
139
if [[ ! -z " ${1} " ]]; then
@@ -96,7 +142,7 @@ case $1 in
96
142
shift ;
97
143
fi
98
144
;;
99
- -ot|--ope_tag )
145
+ --operator_tag )
100
146
shift
101
147
if [[ ! ${1} =~ ^-.* ]]; then
102
148
if [[ ! -z " ${1} " ]]; then
@@ -105,7 +151,25 @@ case $1 in
105
151
shift ;
106
152
fi
107
153
;;
108
- -mm|--maven_mirror)
154
+ --cli_path)
155
+ shift
156
+ if [[ ! ${1} =~ ^-.* ]]; then
157
+ if [[ ! -z " ${1} " ]]; then
158
+ export OPERATOR_CLI_PATH=" ${1} " ;
159
+ fi ;
160
+ shift ;
161
+ fi
162
+ ;;
163
+ --deploy_uri)
164
+ shift
165
+ if [[ ! ${1} =~ ^-.* ]]; then
166
+ if [[ ! -z " ${1} " ]]; then
167
+ export OPERATOR_DEPLOY_FOLDER=" ${1} " ;
168
+ fi ;
169
+ shift ;
170
+ fi
171
+ ;;
172
+ --maven_mirror)
109
173
shift
110
174
if [[ ! ${1} =~ ^-.* ]]; then
111
175
if [[ ! -z " ${1} " ]]; then
@@ -114,53 +178,64 @@ case $1 in
114
178
shift ;
115
179
fi
116
180
;;
117
- -f|--feature )
181
+ --build_image_version )
118
182
shift
119
183
if [[ ! ${1} =~ ^-.* ]]; then
120
184
if [[ ! -z " ${1} " ]]; then
121
- FEATURE =" ${1} " ;
185
+ export KOGITO_BUILD_IMAGE_VERSION =" ${1} " ;
122
186
fi ;
123
187
shift ;
124
188
fi
125
189
;;
126
- -l|--local )
190
+ --build_image_tag )
127
191
shift
128
192
if [[ ! ${1} =~ ^-.* ]]; then
129
193
if [[ ! -z " ${1} " ]]; then
130
- if [ " ${1} " = " true" ]; then
131
- export LOCAL_TESTS=true;
132
- fi
194
+ export KOGITO_BUILD_IMAGE_STREAM_TAG=" ${1} "
133
195
fi ;
134
196
shift ;
135
197
fi
136
198
;;
137
- -c|--concurrent )
199
+ --build_s2i_image_tag )
138
200
shift
139
201
if [[ ! ${1} =~ ^-.* ]]; then
140
202
if [[ ! -z " ${1} " ]]; then
141
- CONCURRENT =" ${1} " ;
203
+ export KOGITO_BUILD_S2I_IMAGE_STREAM_TAG =" ${1} " ;
142
204
fi ;
143
205
shift ;
144
206
fi
145
207
;;
146
- -t|--tags )
208
+ --build_runtime_image_tag )
147
209
shift
148
210
if [[ ! ${1} =~ ^-.* ]]; then
149
211
if [[ ! -z " ${1} " ]]; then
150
- TAGS =" ${1} " ;
212
+ export KOGITO_BUILD_RUNTIME_IMAGE_STREAM_TAG =" ${1} " ;
151
213
fi ;
152
214
shift ;
153
215
fi
154
216
;;
155
- --build_image_version )
217
+ --examples_uri )
156
218
shift
157
219
if [[ ! ${1} =~ ^-.* ]]; then
158
220
if [[ ! -z " ${1} " ]]; then
159
- export KOGITO_BUILD_IMAGE_VERSION =" ${1} " ;
221
+ export KOGITO_EXAMPLES_REPOSITORY_URI =" ${1} " ;
160
222
fi ;
161
223
shift ;
162
224
fi
163
225
;;
226
+ --examples_ref)
227
+ shift
228
+ if [[ ! ${1} =~ ^-.* ]]; then
229
+ if [[ ! -z " ${1} " ]]; then
230
+ export KOGITO_EXAMPLES_REPOSITORY_REF=" ${1} " ;
231
+ fi ;
232
+ shift ;
233
+ fi
234
+ ;;
235
+ --dry-run)
236
+ DRY_RUN=true
237
+ shift
238
+ ;;
164
239
-h|--help)
165
240
usage
166
241
exit 0
@@ -181,6 +256,12 @@ else
181
256
fi
182
257
TAGS=" --tags=${TAGS} "
183
258
259
+ if [[ ${DRY_RUN} ]]; then
260
+ echo " godog -c ${CONCURRENT} --random -f progress " ${TAGS} " ${FEATURE} "
261
+ env
262
+ exit 0
263
+ fi
264
+
184
265
echo " -------- Retrieve godog"
185
266
186
267
go get github.com/DATA-DOG/godog/cmd/godog
0 commit comments