mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
f83c65bcc5
The following are done to avoid travis-ci failing due to too much log size. 1) Update Makefile and scripts to make go build less verbose. 2) Make tdnf less verbose
37 lines
756 B
Bash
Executable File
37 lines
756 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
echo "mode: set" >>profile.cov
|
|
|
|
deps=""
|
|
|
|
# listDeps lists packages referenced by package in $1,
|
|
# excluding golang standard library and packages in
|
|
# direcotry vendor
|
|
function listDeps(){
|
|
pkg=$1
|
|
deps=$pkg
|
|
ds=$(echo $(go list -f '{{.Imports}}' $pkg) | sed 's/[][]//g')
|
|
for d in $ds
|
|
do
|
|
if echo $d | grep -q "github.com/vmware/harbor" && echo $d | grep -qv "vendor"
|
|
then
|
|
deps="$deps,$d"
|
|
fi
|
|
done
|
|
}
|
|
|
|
packages=$(go list ./... | grep -v -E 'vendor|tests')
|
|
|
|
for package in $packages
|
|
do
|
|
listDeps $package
|
|
|
|
# echo "DEBUG: testing package $package"
|
|
go test -race -cover -coverprofile=profile.tmp -coverpkg "$deps" $package
|
|
if [ -f profile.tmp ]
|
|
then
|
|
cat profile.tmp | tail -n +2 >> profile.cov
|
|
rm profile.tmp
|
|
fi
|
|
done
|