mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
Fix issue in profile.cov
profile.cov need to be created inside the _output directory. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
cb08a63a02
commit
04ea2b6f81
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
GOPACKAGES="$(go list ./... | grep -v vendor | grep -v e2e)"
|
||||
COVERFILE="${GO_COVER_DIR}profile.cov"
|
||||
COVERFILE="${GO_COVER_DIR}/profile.cov"
|
||||
|
||||
# no special options, exec to go test w/ all pkgs
|
||||
if [[ ${TEST_EXITFIRST} != "yes" && -z ${TEST_COVERAGE} ]]; then
|
||||
@ -13,17 +13,17 @@ fi
|
||||
# at at time
|
||||
if [[ ${TEST_COVERAGE} ]]; then
|
||||
GOTESTOPTS="-covermode=count -coverprofile=cover.out"
|
||||
echo "mode: count" > "${COVERFILE}"
|
||||
echo "mode: count" >"${COVERFILE}"
|
||||
fi
|
||||
|
||||
failed=0
|
||||
for gopackage in ${GOPACKAGES}; do
|
||||
echo "--- testing: ${gopackage} ---"
|
||||
# shellcheck disable=SC2086
|
||||
go test ${GOTESTOPTS} "${gopackage}" || ((failed+=1))
|
||||
go test ${GOTESTOPTS} "${gopackage}" || ((failed += 1))
|
||||
if [[ -f cover.out ]]; then
|
||||
# Append to coverfile
|
||||
grep -v "^mode: count" cover.out >> "${COVERFILE}"
|
||||
grep -v "^mode: count" cover.out >>"${COVERFILE}"
|
||||
fi
|
||||
if [[ ${TEST_COVERAGE} = "stdout" && -f cover.out ]]; then
|
||||
go tool cover -func=cover.out
|
||||
|
Loading…
Reference in New Issue
Block a user