entrypoint: highlight important commands in script output

Add a small wrapper function 'show' that prints a prefix and the
command that will be run. Helps the reader jump to important parts of
the script output.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-02-03 15:00:23 -05:00 committed by Niels de Vos
parent 7790594ee4
commit 7d12f0bbcd
1 changed files with 8 additions and 3 deletions

View File

@ -51,6 +51,11 @@ while true ; do
esac
done
show() {
echo "*** running:" "$@"
"$@"
}
test_failed() {
local pkg="$1"
echo "*** ERROR: ${pkg} tests failed"
@ -73,7 +78,7 @@ test_pkg() {
testargs+=("-run" "${TEST_RUN}")
fi
go test -v "${testargs[@]}" "./$pkg"
show go test -v "${testargs[@]}" "./$pkg"
ret=$?
grep -v "^mode: count" "$pkg.cover.out" >> "cover.out"
return ${ret}
@ -92,12 +97,12 @@ pre_all_tests() {
post_all_tests() {
mkdir -p /results/coverage
go tool cover -html=cover.out -o /results/coverage/go-ceph.html
show go tool cover -html=cover.out -o /results/coverage/go-ceph.html
}
test_go_ceph() {
mkdir -p /tmp/ceph
"${MICRO_OSD_PATH}" /tmp/ceph
show "${MICRO_OSD_PATH}" /tmp/ceph
export CEPH_CONF=/tmp/ceph/ceph.conf
if [[ ${TEST_RUN} == NONE ]]; then