Azure: Report elapsed time

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin
2020-02-25 17:46:47 +03:00
committed by Alexander Bokovoy
parent 38e0a9f4c0
commit 0a1e98cdf0

View File

@@ -24,22 +24,22 @@ steps:
mkdir "$project_dir" mkdir "$project_dir"
# live-logging of tests within environment: '1' # live-logging of tests within environment: '1'
if [ "$project_id" == "1" ]; then if [ "$project_id" == "1" ]; then
./azure-run-tests.sh "$project_id" 2>&1 | \ /usr/bin/time \
--format="tests: ${project_name}, result: %x, time: %E" \
--output="result_${project_id}" \
-- \
./azure-run-tests.sh "$project_id" 2>&1 | \
ts '[%Y-%m-%d %H:%M:%S]' 2>&1 | tee "${project_dir}/${logfile}" ts '[%Y-%m-%d %H:%M:%S]' 2>&1 | tee "${project_dir}/${logfile}"
result=$? result=$?
else else
./azure-run-tests.sh "$project_id" 2>&1 | \ /usr/bin/time \
--format="tests: ${project_name}, result: %x, time: %E" \
--output="result_${project_id}" \
-- \
./azure-run-tests.sh "$project_id" 2>&1 | \
ts '[%Y-%m-%d %H:%M:%S]' 2>&1 > "${project_dir}/${logfile}" ts '[%Y-%m-%d %H:%M:%S]' 2>&1 > "${project_dir}/${logfile}"
result=$? result=$?
fi fi
result_file="result_${project_id}"
if [ "$result" -eq 0 ]; then
result_msg="${project_name}: PASSED"
else
result_msg="${project_name}: FAILED"
fi
echo "$result_msg" > "$result_file"
exit $result exit $result
} }
export -f runner export -f runner