Run ginkgo in foreground, elminiate wait & pgrep

Use bash process substitution for sending ginkgo output through tee,
allowing easy capture of the ginkgo exit code and avoiding use of wait
or pgrep.

For #78699
This commit is contained in:
Erik Wilson 2019-07-31 00:53:08 -07:00
parent ad899665ea
commit 2242718e17

View File

@ -67,9 +67,8 @@ ginkgo_args+=(
)
set -x
/usr/local/bin/ginkgo "${ginkgo_args[@]}" /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider="${E2E_PROVIDER}" --report-dir="${RESULTS_DIR}" --kubeconfig="${KUBECONFIG}" -v="${E2E_VERBOSITY}" | tee "${RESULTS_DIR}"/e2e.log &
/usr/local/bin/ginkgo "${ginkgo_args[@]}" /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider="${E2E_PROVIDER}" --report-dir="${RESULTS_DIR}" --kubeconfig="${KUBECONFIG}" -v="${E2E_VERBOSITY}" > >(tee "${RESULTS_DIR}"/e2e.log)
ret=$?
set +x
# $! is the pid of tee, not ginkgo
wait "$(pgrep ginkgo)" && ret=0 || ret=$?
saveResults
exit ${ret}