File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,22 @@ test_results() {
227
227
echo " [ERROR] Unable to retrieve $1 for $RESULT_UID from pipeline run $pipeline_name " >&2
228
228
exit 1
229
229
fi
230
+
231
+ # Let's make request to get log output and check it.
232
+ if [ " ${1} " == " logs" ]; then
233
+ LOG_PATH=$( echo " ${QUERY_RESULT} " | jq -r " .records[0] | .name" )
234
+
235
+ QUERY_URL=" https://$RESULT_ROUTE /apis/results.tekton.dev/v1alpha2/parents/${LOG_PATH} "
236
+ QUERY_CMD[6]=" ${QUERY_URL} "
237
+ LOGS_RESULT=$( " ${QUERY_CMD[@]} " 2> /dev/null)
238
+ LOGS_OUTPUT=$( echo " $LOGS_RESULT " | jq -r " .result.data | @base64d" )
239
+
240
+ if ! echo " $LOGS_OUTPUT " | grep -qF " PipelineRun name from params:" ; then
241
+ echo " [ERROR] Unable to retrieve logs output."
242
+ printf " [ERROR] Log record: %s \n" " ${LOGS_RESULT} "
243
+ exit 1
244
+ fi
245
+ fi
230
246
}
231
247
232
248
echo
You can’t perform that action at this time.
0 commit comments