Skip to content

Commit 36c6b83

Browse files
committed
Update st2-self-check so it prints out output of st2 run on test
failure. Without doing that it's impossible to debug some test failures which are due to action not taking all the parameters or similar.
1 parent 152b418 commit 36c6b83

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

st2common/bin/st2-self-check

+10-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ do
140140
echo "Skipping ${TEST}..."
141141
continue
142142
fi
143-
143+
144144
# Skip Mistral Inquiry test if we're not running Mistral tests
145145
if [ ${RUN_MISTRAL_TESTS} = "false" ] && [ ${TEST} = "tests.test_inquiry_mistral" ]; then
146146
echo "Skipping ${TEST}..."
@@ -150,13 +150,15 @@ do
150150
echo -n "Attempting Test ${TEST}..."
151151

152152
START_TS=$(date +%s)
153-
st2 run ${TEST} protocol=${PROTOCOL} token=${ST2_AUTH_TOKEN} | grep "status" | grep -q "succeeded"
153+
OUTPUT=$(st2 run ${TEST} protocol=${PROTOCOL} token=${ST2_AUTH_TOKEN})
154+
echo ${OUTPUT} | grep "status" | grep -q "succeeded"
154155
EXIT_CODE=$?
155156
END_TS=$(date +%s)
156157
DURATION=$(expr ${END_TS} - ${START_TS})
157158

158159
if [ ${EXIT_CODE} -ne 0 ]; then
159160
echo -e "ERROR! (${DURATION}s)"
161+
echo "Test output: ${OUTPUT}"
160162
((ERRORS++))
161163
else
162164
echo "OK! (${DURATION}s)"
@@ -167,13 +169,15 @@ if [ ${RUN_MISTRAL_TESTS} = "true" ]; then
167169
echo -n "Attempting Example examples.mistral_examples..."
168170

169171
START_TS=$(date +%s)
170-
st2 run examples.mistral_examples | grep "status" | grep -q "succeeded"
172+
OUTPUT=$(st2 run examples.mistral_examples)
173+
echo ${OUTPUT} | grep "status" | grep -q "succeeded"
171174
EXIT_CODE=$?
172175
END_TS=$(date +%s)
173176
DURATION=$(expr ${END_TS} - ${START_TS})
174177

175178
if [ ${EXIT_CODE} -ne 0 ]; then
176179
echo -e "ERROR! (${DURATION}s)"
180+
echo "Test output: ${OUTPUT}"
177181
((ERRORS++))
178182
else
179183
echo "OK! (${DURATION}s)"
@@ -186,13 +190,15 @@ if [ ${RUN_ORQUESTA_TESTS} = "true" ]; then
186190
echo -n "Attempting Example examples.orquesta-examples..."
187191

188192
START_TS=$(date +%s)
189-
st2 run examples.orquesta-examples | grep "status" | grep -q "succeeded"
193+
OUTPUT=$(st2 run examples.orquesta-examples)
194+
echo ${OUTPUT} | grep "status" | grep -q "succeeded"
190195
EXIT_CODE=$?
191196
END_TS=$(date +%s)
192197
DURATION=$(expr ${END_TS} - ${START_TS})
193198

194199
if [ ${EXIT_CODE} -ne 0 ]; then
195200
echo -e "ERROR! (${DURATION}s)"
201+
echo "Test output: ${OUTPUT}"
196202
((ERRORS++))
197203
else
198204
echo "OK! (${DURATION}s)"

0 commit comments

Comments
 (0)