Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to test a single package w/o cover report #3794

Merged
merged 1 commit into from
Jan 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 14 additions & 4 deletions hack/test-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,26 @@ if [[ $iterations -gt 1 ]]; then
fi

if [[ -n "${1-}" ]]; then
covdir="/tmp/k8s_coverage/$(kube::util::sortable_date)"
kube::log::status "Saving coverage output in '${covdir}'"
cover_report_dir=""
if [[ -n "${KUBE_COVER}" ]]; then
cover_report_dir="/tmp/k8s_coverage/$(kube::util::sortable_date)"
kube::log::status "Saving coverage output in '${cover_report_dir}'"
fi

for arg; do
trap 'exit 1' SIGINT
mkdir -p "${covdir}/${arg}"
pkg=${KUBE_GO_PACKAGE}/${arg}

cover_params=()
if [[ -n "${KUBE_COVER}" ]]; then
mkdir -p "${cover_report_dir}/${arg}"
cover_params=(${KUBE_COVER} -coverprofile="${cover_report_dir}/${arg}/coverage.out")
fi

go test "${goflags[@]:+${goflags[@]}}" \
${KUBE_RACE} \
${KUBE_TIMEOUT} \
${KUBE_COVER} -coverprofile="${covdir}/${arg}/coverage.out" \
"${cover_params[@]+${cover_params[@]}}" \
"${pkg}"
done
exit 0
Expand Down