Commit c14ffd3c authored by Erik Wilson's avatar Erik Wilson

Clean up sonobuoy e2e tests

parent 853708c8
...@@ -148,8 +148,14 @@ sonobuoy retrieve ${OUTPUT} ...@@ -148,8 +148,14 @@ sonobuoy retrieve ${OUTPUT}
results="./plugins/e2e/results/e2e.log" results="./plugins/e2e/results/e2e.log"
[ -s ${results} ] || exit 1 [ -s ${results} ] || exit 1
tail -20 ${results} tail -20 ${results}
exit_code=0
status=$(tail -5 ${results} | grep '^SUCCESS!.*| 0 Failed |' >/dev/null && echo passed || echo failed) 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 if [ -n "${E2E_LOG_OUTPUT}" ]; then
cp ${results} $(echo ${E2E_LOG_OUTPUT} | sed -e "s/-STATUS-/-${status}-/g") cp ${results} $(echo ${E2E_LOG_OUTPUT} | sed -e "s/-STATUS-/-${status}-/g")
fi fi
exit ${exit_code}
) )
...@@ -3,6 +3,15 @@ set -e -x ...@@ -3,6 +3,15 @@ set -e -x
cd $(dirname $0)/.. 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 if [ -z "$K3S_IMAGE" ]; then
source $(dirname $0)/version.sh source $(dirname $0)/version.sh
TAG=${TAG:-${VERSION}${SUFFIX}} TAG=${TAG:-${VERSION}${SUFFIX}}
...@@ -23,19 +32,17 @@ run-sonobuoy() { ...@@ -23,19 +32,17 @@ run-sonobuoy() {
pids+=($!) pids+=($!)
} }
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-serial.log \ log_output=${OUTPUT}/e2e-STATUS-${ARCH}-serial.log \
run-sonobuoy --e2e-focus='\[Serial\].*\[Conformance\]' run-sonobuoy --e2e-focus='\[Serial\].*\[Conformance\]'
log_output=${OUTPUT}/e2e-STATUS-${ARCH}-parallel.log \ log_output=${OUTPUT}/e2e-STATUS-${ARCH}-parallel.log \
run-sonobuoy --e2e-focus='\[Conformance\]' --e2e-skip='\[Serial\]' --e2e-parallel=y run-sonobuoy --e2e-focus='\[Conformance\]' --e2e-skip='\[Serial\]' --e2e-parallel=y
cleanup() {
exit_status=$? exit_code=0
set +e for pid in "${pids[@]}"; do
echo "Waiting on the tests!" wait $pid || exit_code=$?
wait done
exit ${exit_status}
}
trap cleanup EXIT
wait ${pids[@]}
trap - EXIT trap - EXIT
exit ${exit_code}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment