You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2022. It is now read-only.
local url="${GLASSFISH_REMOTE_QUEUE_URL}/api/xml?xpath=//lastBuild/number/text()"
135
-
curl "${url}"
136
-
local error_code=${?}
137
-
if [ ${error_code}-ne 0 ] ;then
138
-
exit 1
139
-
fi
140
-
}
141
-
142
-
#
143
-
# Find a test job for TEST_ID
144
-
#
145
-
# Args: TEST_ID PREVIOUS_LAST_BUILD
146
-
#
147
-
find_test_job(){
148
-
local previous_last_build=${1}
149
-
local last_build=`get_test_job_last_build_number`
150
-
151
-
# nothing running and nothing new completed
152
-
if [ "${previous_last_build}"="${last_build}" ] ;then
153
-
return 1
154
-
fi
155
-
156
-
# look into the newly completed run
157
-
local i=$((previous_last_build+1))
158
-
while [ ${i}-le${last_build} ]
159
-
do
160
-
local params
161
-
params[0]="BRANCH=${branch}"
162
-
params[1]="TEST_IDS=${test_ids_triggerd}"
163
-
params[2]="PR_NUMBER"
164
-
params[3]="FORK_ORIGIN=${fork_origin}"
165
-
if`is_test_job_match ${i}"${params[*]}"`;then
166
-
# the triggered run is already completed
167
-
echo${i}
168
-
return 0
169
-
fi
170
-
i=$((i+1))
171
-
done
172
-
173
-
# not found
174
-
return 1
175
-
}
176
-
177
42
USAGE="Usage:\n\n 1. rq.sh -l ---> List all available test identifiers without running them\n\
178
-
2. rq.sh -b <branch> -a ---> For running all tests\n\
43
+
2. rq.sh -b <branch> -a ---> For running all tests in remote branch\n\
179
44
3. rq.sh -b <branch> -g <test_group_name> ---> For running a test group\n\
180
-
4. rq.sh -b <branch> -t \"<test_id1> <test_id2> <test_id3>\" ---> For running a space separated list of tests"
45
+
4. rq.sh -b <branch> -t \"<test_id1> <test_id2> <test_id3>\" ---> For running a space separated list of tests\n\
46
+
5. rq.sh -u <glassfish binary url> -a|-u|-t ---> For running all tests with GlassFish binary provided in the http url.-u option works with -a, -g and -t options as well\n\
47
+
6. rq.sh -b <branch> -a|-u|-t -e <email-id> ---> For getting the test results in the email id.This works with -a -t and -g options"
48
+
181
49
182
50
list_test_ids(){
183
51
forruntestin`find . -name run_test\.sh`;do
@@ -206,15 +74,17 @@ then
206
74
echo -e $USAGE
207
75
exit 0
208
76
fi
209
-
whilegetopts":b:t:g:al" opt;do
77
+
whilegetopts":b:t:g:e:u:al" opt;do
210
78
case"$opt"in
211
79
b) branch=$OPTARG;;
212
80
t) test_ids=($OPTARG);;
213
81
a) test_ids=(`list_test_ids`);;
214
-
g) test_ids=(`list_group_test_ids $OPTARG`);;
215
-
l) test_ids=(`list_test_ids`)
82
+
g) test_ids=(`list_group_test_ids $OPTARG`);;
83
+
l) test_ids=(`list_test_ids`)
216
84
echo${test_ids[@]}| tr """\n"
217
85
exit 0;;
86
+
e) GLASSFISH_REMOTE_QUEUE_EMAIL=$OPTARG;;
87
+
u) url=$OPTARG;;
218
88
*) echo -e "Invalid option"
219
89
echo -e $USAGE
220
90
exit 1 ;;
@@ -223,8 +93,8 @@ done
223
93
224
94
shift$((OPTIND-1))
225
95
226
-
if [[ -z$branch ]];then
227
-
echo"branch is missing"
96
+
if [[ -z$branch&&-z$url]];then
97
+
echo"Please provide a remote branch or a glassfish binary url to trigger glassfish remote queue"
228
98
echo -e $USAGE
229
99
exit 1
230
100
fi
@@ -233,24 +103,21 @@ if [[ -z $test_ids ]]; then
233
103
echo -e $USAGE
234
104
exit 1
235
105
fi
106
+
if [[ -z$GLASSFISH_REMOTE_QUEUE_EMAIL&&!-z$branch ]];then
0 commit comments