mirror of
https://github.com/helm/helm.git
synced 2026-06-30 19:57:48 +00:00
feat(ci): run test coverage in parallel
``` ./scripts/coverage.sh 37.25s user 4.15s system 144% cpu 28.615 total ``` ``` ./scripts/coverage.sh 47.96s user 6.77s system 567% cpu 9.647 total ```
This commit is contained in:
@@ -25,10 +25,22 @@ hash godir 2>/dev/null || go get github.com/Masterminds/godir
|
||||
|
||||
generate_cover_data() {
|
||||
for d in $(godir) ; do
|
||||
local output="${coverdir}/${d//\//-}.cover"
|
||||
go test -coverprofile="${output}" -covermode="$covermode" "$d"
|
||||
(
|
||||
local output="${coverdir}/${d//\//-}.cover"
|
||||
go test -coverprofile="${output}" -covermode="$covermode" "$d"
|
||||
) &
|
||||
done
|
||||
|
||||
local fails
|
||||
fails=0
|
||||
for job in $(jobs -p); do
|
||||
wait "${job}" || let "fails+=1"
|
||||
done
|
||||
if (( fails != 0 )); then
|
||||
echo "FAILED"
|
||||
exit ${fails}
|
||||
fi
|
||||
|
||||
echo "mode: $covermode" >"$profile"
|
||||
grep -h -v "^mode:" "$coverdir"/*.cover >>"$profile"
|
||||
}
|
||||
@@ -40,7 +52,7 @@ push_to_coveralls() {
|
||||
generate_cover_data
|
||||
go tool cover -func "${profile}"
|
||||
|
||||
case "$1" in
|
||||
case "${1-}" in
|
||||
--html)
|
||||
go tool cover -html "${profile}"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user