Skip to content

Commit cb86488

Browse files
radtristeMarianMacik
authored andcommitted
[KOGITO-998] Setup all run-smoke params into Makefile (apache#163)
1 parent d6341a1 commit cb86488

File tree

2 files changed

+392
-23
lines changed

2 files changed

+392
-23
lines changed

hack/run-smoke.sh

Lines changed: 104 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,27 @@ function usage(){
3434
printf "\nOptions:"
3535
printf "\n"
3636
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."
4538
printf "\n\tExpressions can be:"
4639
printf "\n\t\t- '@wip': run all scenarios with wip tag"
4740
printf "\n\t\t- '~@wip': exclude all scenarios with wip tag"
4841
printf "\n\t\t- '@wip && ~@new': run wip scenarios, but exclude new"
4942
printf "\n\t\t- '@wip,@undone': run wip or undone scenarios"
5043
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."
5158
printf "\n"
5259
}
5360

@@ -83,11 +90,50 @@ function delete_and_apply_crds(){
8390
FEATURE=""
8491
CONCURRENT=1
8592
TAGS=""
93+
DRY_RUN=
8694

8795
while (( $# ))
8896
do
8997
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)
91137
shift
92138
if [[ ! ${1} =~ ^-.* ]]; then
93139
if [[ ! -z "${1}" ]]; then
@@ -96,7 +142,7 @@ case $1 in
96142
shift;
97143
fi
98144
;;
99-
-ot|--ope_tag)
145+
--operator_tag)
100146
shift
101147
if [[ ! ${1} =~ ^-.* ]]; then
102148
if [[ ! -z "${1}" ]]; then
@@ -105,7 +151,25 @@ case $1 in
105151
shift;
106152
fi
107153
;;
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)
109173
shift
110174
if [[ ! ${1} =~ ^-.* ]]; then
111175
if [[ ! -z "${1}" ]]; then
@@ -114,53 +178,64 @@ case $1 in
114178
shift;
115179
fi
116180
;;
117-
-f|--feature)
181+
--build_image_version)
118182
shift
119183
if [[ ! ${1} =~ ^-.* ]]; then
120184
if [[ ! -z "${1}" ]]; then
121-
FEATURE="${1}";
185+
export KOGITO_BUILD_IMAGE_VERSION="${1}";
122186
fi;
123187
shift;
124188
fi
125189
;;
126-
-l|--local)
190+
--build_image_tag)
127191
shift
128192
if [[ ! ${1} =~ ^-.* ]]; then
129193
if [[ ! -z "${1}" ]]; then
130-
if [ "${1}" = "true" ]; then
131-
export LOCAL_TESTS=true;
132-
fi
194+
export KOGITO_BUILD_IMAGE_STREAM_TAG="${1}"
133195
fi;
134196
shift;
135197
fi
136198
;;
137-
-c|--concurrent)
199+
--build_s2i_image_tag)
138200
shift
139201
if [[ ! ${1} =~ ^-.* ]]; then
140202
if [[ ! -z "${1}" ]]; then
141-
CONCURRENT="${1}";
203+
export KOGITO_BUILD_S2I_IMAGE_STREAM_TAG="${1}";
142204
fi;
143205
shift;
144206
fi
145207
;;
146-
-t|--tags)
208+
--build_runtime_image_tag)
147209
shift
148210
if [[ ! ${1} =~ ^-.* ]]; then
149211
if [[ ! -z "${1}" ]]; then
150-
TAGS="${1}";
212+
export KOGITO_BUILD_RUNTIME_IMAGE_STREAM_TAG="${1}";
151213
fi;
152214
shift;
153215
fi
154216
;;
155-
--build_image_version)
217+
--examples_uri)
156218
shift
157219
if [[ ! ${1} =~ ^-.* ]]; then
158220
if [[ ! -z "${1}" ]]; then
159-
export KOGITO_BUILD_IMAGE_VERSION="${1}";
221+
export KOGITO_EXAMPLES_REPOSITORY_URI="${1}";
160222
fi;
161223
shift;
162224
fi
163225
;;
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+
;;
164239
-h|--help)
165240
usage
166241
exit 0
@@ -181,6 +256,12 @@ else
181256
fi
182257
TAGS="--tags=${TAGS}"
183258

259+
if [[ ${DRY_RUN} ]]; then
260+
echo "godog -c ${CONCURRENT} --random -f progress "${TAGS}" ${FEATURE}"
261+
env
262+
exit 0
263+
fi
264+
184265
echo "-------- Retrieve godog"
185266

186267
go get github.com/DATA-DOG/godog/cmd/godog

0 commit comments

Comments
 (0)