Clean up sonobuoy e2e tests

This commit is contained in:
Erik Wilson 2019-07-01 08:29:57 -07:00
parent 853708c8ba
commit c14ffd3c6c
2 changed files with 22 additions and 9 deletions

View File

@ -148,8 +148,14 @@ sonobuoy retrieve ${OUTPUT}
results="./plugins/e2e/results/e2e.log"
[ -s ${results} ] || exit 1
tail -20 ${results}
exit_code=0
status=$(tail -5 ${results} | grep '^SUCCESS!.*| 0 Failed |' >/dev/null && echo passed || echo failed)
[ "${status}" = "failed" ] && exit_code=1
if [ -n "${E2E_LOG_OUTPUT}" ]; then
cp ${results} $(echo ${E2E_LOG_OUTPUT} | sed -e "s/-STATUS-/-${status}-/g")
fi
exit ${exit_code}
)

View File

@ -3,6 +3,15 @@ set -e -x
cd $(dirname $0)/..
cleanup() {
exit_code=$?
set +e
echo "Waiting on the tests!"
wait
exit ${exit_code}
}
trap cleanup EXIT
if [ -z "$K3S_IMAGE" ]; then
source $(dirname $0)/version.sh
TAG=${TAG:-${VERSION}${SUFFIX}}
@ -23,19 +32,17 @@ run-sonobuoy() {
pids+=($!)
}
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-serial.log \
run-sonobuoy --e2e-focus='\[Serial\].*\[Conformance\]'
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-parallel.log \
run-sonobuoy --e2e-focus='\[Conformance\]' --e2e-skip='\[Serial\]' --e2e-parallel=y
cleanup() {
exit_status=$?
set +e
echo "Waiting on the tests!"
wait
exit ${exit_status}
}
trap cleanup EXIT
wait ${pids[@]}
exit_code=0
for pid in "${pids[@]}"; do
wait $pid || exit_code=$?
done
trap - EXIT
exit ${exit_code}