Unverified Commit 02c094f3 authored by Erik Wilson's avatar Erik Wilson Committed by GitHub

Merge pull request #596 from erikwilson/e2e-watch-fix

Clean up sonobuoy e2e tests
parents 853708c8 c9383be7
...@@ -2,7 +2,7 @@ FROM golang:1.12.1-alpine3.9 ...@@ -2,7 +2,7 @@ FROM golang:1.12.1-alpine3.9
RUN apk -U --no-cache add bash git docker curl jq coreutils RUN apk -U --no-cache add bash git docker curl jq coreutils
RUN go get -d github.com/heptio/sonobuoy && \ RUN go get -d github.com/heptio/sonobuoy && \
git -C /go/src/github.com/heptio/sonobuoy checkout -b current v0.14.2 && \ git -C /go/src/github.com/heptio/sonobuoy checkout -b current v0.14.3 && \
go install github.com/heptio/sonobuoy go install github.com/heptio/sonobuoy
RUN rm -rf /go/src /go/pkg RUN rm -rf /go/src /go/pkg
......
...@@ -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