2015-07-21 02:32:42 +03:00
|
|
|
#!/usr/bin/env bash
|
2014-09-09 10:06:03 +04:00
|
|
|
#
|
|
|
|
# Run all etcd tests
|
|
|
|
# ./test
|
|
|
|
# ./test -v
|
|
|
|
#
|
|
|
|
# Run tests for one package
|
|
|
|
#
|
|
|
|
# PKG=./wal ./test
|
|
|
|
# PKG=snap ./test
|
2016-12-28 02:15:57 +03:00
|
|
|
#
|
2017-02-24 01:39:34 +03:00
|
|
|
# Run code coverage
|
2017-01-31 03:05:21 +03:00
|
|
|
# COVERDIR must either be a absolute path or a relative path to the etcd root
|
|
|
|
# COVERDIR=coverage PASSES="build_cov cov" ./test
|
2015-07-21 02:32:42 +03:00
|
|
|
set -e
|
2014-09-09 10:06:03 +04:00
|
|
|
|
2016-06-21 22:12:50 +03:00
|
|
|
source ./build
|
|
|
|
|
2016-08-16 23:46:07 +03:00
|
|
|
# build tests with vendored dependencies
|
|
|
|
etcd_setup_gopath
|
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
if [ -z "$PASSES" ]; then
|
|
|
|
PASSES="fmt dep compile build unit"
|
|
|
|
fi
|
|
|
|
|
2014-09-09 10:06:03 +04:00
|
|
|
# Invoke ./cover for HTML output
|
|
|
|
COVER=${COVER:-"-cover"}
|
|
|
|
|
2014-09-23 04:11:20 +04:00
|
|
|
# Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.
|
2016-10-11 14:53:40 +03:00
|
|
|
IGNORE_PKGS="(cmd|vendor|etcdserverpb|rafttest|gopath.proto)"
|
2016-06-17 21:17:17 +03:00
|
|
|
INTEGRATION_PKGS="(integration|e2e|contrib|functional-tester)"
|
2017-03-14 09:58:29 +03:00
|
|
|
|
|
|
|
# all github.com/coreos/etcd/whatever pkgs that are not auto-generated / tools
|
|
|
|
PKGS=`find . -name \*.go | while read a; do dirname $a; done | sort | uniq | egrep -v "$IGNORE_PKGS" | egrep -v "(tools/|contrib/|e2e|pb)" | sed "s|\.|${REPO_PATH}|g"`
|
|
|
|
# pkg1,pkg2,pkg3
|
|
|
|
PKGS_COMMA=`echo ${PKGS} | sed 's/ /,/g'`
|
|
|
|
|
2016-06-17 21:17:17 +03:00
|
|
|
TEST_PKGS=`find . -name \*_test.go | while read a; do dirname $a; done | sort | uniq | egrep -v "$IGNORE_PKGS" | sed "s|\./||g"`
|
|
|
|
FORMATTABLE=`find . -name \*.go | while read a; do echo $(dirname $a)/"*.go"; done | sort | uniq | egrep -v "$IGNORE_PKGS" | sed "s|\./||g"`
|
|
|
|
TESTABLE_AND_FORMATTABLE=`echo "$TEST_PKGS" | egrep -v "$INTEGRATION_PKGS"`
|
2014-09-09 10:06:03 +04:00
|
|
|
|
2016-12-09 22:16:03 +03:00
|
|
|
# TODO: 'client' pkg fails with gosimple from generated files
|
|
|
|
# TODO: 'rafttest' is failing with unused
|
2017-03-07 00:38:02 +03:00
|
|
|
STATIC_ANALYSIS_PATHS=`find . -name \*.go | while read a; do dirname $a; done | sort | uniq | egrep -v "$IGNORE_PKGS" | grep -v 'client'`
|
2016-12-09 22:16:03 +03:00
|
|
|
|
2016-10-04 23:42:53 +03:00
|
|
|
if [ -z "$GOARCH" ]; then
|
|
|
|
GOARCH=$(go env GOARCH);
|
|
|
|
fi
|
|
|
|
|
2014-09-09 10:06:03 +04:00
|
|
|
# user has not provided PKG override
|
|
|
|
if [ -z "$PKG" ]; then
|
2014-10-30 02:14:31 +03:00
|
|
|
TEST=$TESTABLE_AND_FORMATTABLE
|
2014-09-09 10:06:03 +04:00
|
|
|
FMT=$FORMATTABLE
|
|
|
|
|
|
|
|
# user has provided PKG override
|
|
|
|
else
|
|
|
|
# strip out leading dotslashes and trailing slashes from PKG=./foo/
|
|
|
|
TEST=${PKG/#./}
|
|
|
|
TEST=${TEST/#\//}
|
|
|
|
TEST=${TEST/%\//}
|
|
|
|
|
|
|
|
# only run gofmt on packages provided by user
|
|
|
|
FMT="$TEST"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# split TEST into an array and prepend REPO_PATH to each local package
|
|
|
|
split=(${TEST// / })
|
|
|
|
TEST=${split[@]/#/${REPO_PATH}/}
|
2016-07-15 04:13:07 +03:00
|
|
|
|
|
|
|
# determine whether target supports race detection
|
2016-10-04 23:42:53 +03:00
|
|
|
if [ "$GOARCH" == "amd64" ]; then
|
2016-03-27 12:07:32 +03:00
|
|
|
RACE="--race"
|
|
|
|
fi
|
2014-09-09 10:06:03 +04:00
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
function unit_pass {
|
|
|
|
echo "Running unit tests..."
|
2016-04-15 10:18:24 +03:00
|
|
|
# only -run=Test so examples can run in integration tests
|
|
|
|
go test -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 -run=Test $@ ${TEST}
|
2016-01-18 11:07:09 +03:00
|
|
|
}
|
2014-09-09 10:06:03 +04:00
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
function integration_pass {
|
|
|
|
echo "Running integration tests..."
|
2016-10-06 01:35:14 +03:00
|
|
|
go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration
|
|
|
|
go test -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration
|
|
|
|
go test -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration
|
|
|
|
go test -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample
|
|
|
|
go test -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST}
|
|
|
|
}
|
|
|
|
|
2016-12-28 02:15:57 +03:00
|
|
|
function cov_pass {
|
|
|
|
echo "Running code coverage..."
|
|
|
|
# install gocovmerge before running code coverage from github.com/wadey/gocovmerge
|
2017-02-24 01:39:34 +03:00
|
|
|
# gocovmerge merges coverage files
|
2016-12-28 02:15:57 +03:00
|
|
|
if ! which gocovmerge >/dev/null; then
|
|
|
|
echo "gocovmerge not installed"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$COVERDIR" ]; then
|
|
|
|
echo "COVERDIR undeclared"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
2017-01-31 03:05:21 +03:00
|
|
|
if [ ! -f "bin/etcd_test" ]; then
|
|
|
|
echo "etcd_test binary not found"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
2016-12-28 02:15:57 +03:00
|
|
|
mkdir -p "$COVERDIR"
|
|
|
|
|
2017-01-31 03:05:21 +03:00
|
|
|
# run code coverage for unit and integration tests
|
2017-03-14 09:58:29 +03:00
|
|
|
for t in `echo "${TEST_PKGS}" | egrep -v "(e2e|functional-tester)"`; do
|
2016-12-28 02:15:57 +03:00
|
|
|
tf=`echo $t | tr / _`
|
2017-03-09 09:24:16 +03:00
|
|
|
# cache package compilation data for faster repeated builds
|
2017-03-14 09:58:29 +03:00
|
|
|
go test -covermode=set -coverpkg $PKGS_COMMA -i -v ${REPO_PATH}/$t
|
2017-01-31 03:05:21 +03:00
|
|
|
# uses -run=Test to skip examples because clientv3/ example tests will leak goroutines
|
2017-03-14 09:58:29 +03:00
|
|
|
go test -covermode=set -coverpkg $PKGS_COMMA -timeout 15m -run=Test -v -coverprofile "$COVERDIR/${tf}.coverprofile" ${REPO_PATH}/$t
|
2016-12-28 02:15:57 +03:00
|
|
|
done
|
|
|
|
|
2017-01-31 03:05:21 +03:00
|
|
|
# run code coverage for e2e tests
|
2017-02-24 01:39:34 +03:00
|
|
|
# use 30m timeout because e2e coverage takes longer
|
2017-01-31 03:05:21 +03:00
|
|
|
# due to many tests cause etcd process to wait
|
|
|
|
# on leadership transfer timeout during gracefully shutdown
|
|
|
|
go test -tags cov -timeout 30m -v ${REPO_PATH}"/e2e"
|
|
|
|
|
2016-12-28 02:15:57 +03:00
|
|
|
gocovmerge "$COVERDIR"/*.coverprofile >"$COVERDIR"/cover.out
|
|
|
|
}
|
|
|
|
|
2016-10-06 01:35:14 +03:00
|
|
|
function e2e_pass {
|
|
|
|
echo "Running e2e tests..."
|
2017-01-26 07:55:37 +03:00
|
|
|
go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e
|
2016-10-06 01:35:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function integration_e2e_pass {
|
|
|
|
echo "Running integration and e2e tests..."
|
2016-07-11 20:43:42 +03:00
|
|
|
|
2017-01-26 07:55:37 +03:00
|
|
|
go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e &
|
2016-04-28 20:02:36 +03:00
|
|
|
e2epid="$!"
|
|
|
|
go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration &
|
2016-05-16 16:32:38 +03:00
|
|
|
intpid="$!"
|
2016-04-28 20:02:36 +03:00
|
|
|
wait $e2epid
|
|
|
|
wait $intpid
|
2016-07-08 01:22:03 +03:00
|
|
|
go test -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration
|
2016-03-27 12:07:32 +03:00
|
|
|
go test -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration
|
2015-12-22 01:05:14 +03:00
|
|
|
go test -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample
|
2016-04-15 10:18:24 +03:00
|
|
|
go test -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST}
|
2016-01-18 11:07:09 +03:00
|
|
|
}
|
2014-09-09 10:06:03 +04:00
|
|
|
|
2016-07-06 19:27:02 +03:00
|
|
|
function grpcproxy_pass {
|
2016-12-29 01:56:57 +03:00
|
|
|
go test -timeout 15m -v ${RACE} -tags cluster_proxy -cpu 1,2,4 $@ ${REPO_PATH}/integration
|
2017-02-02 04:22:58 +03:00
|
|
|
go test -timeout 15m -v ${RACE} -tags cluster_proxy -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration
|
2016-07-06 19:27:02 +03:00
|
|
|
}
|
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
function release_pass {
|
2016-10-04 23:42:53 +03:00
|
|
|
rm -f ./bin/etcd-last-release
|
2016-08-31 06:54:07 +03:00
|
|
|
# to grab latest patch release; bump this up for every minor release
|
2017-02-24 01:39:34 +03:00
|
|
|
UPGRADE_VER=$(git tag -l --sort=-version:refname "v3.1.*" | head -1)
|
2016-07-15 04:13:07 +03:00
|
|
|
if [ -n "$MANUAL_VER" ]; then
|
|
|
|
# in case, we need to test against different version
|
|
|
|
UPGRADE_VER=$MANUAL_VER
|
|
|
|
fi
|
2016-10-04 23:42:53 +03:00
|
|
|
|
|
|
|
local file="etcd-$UPGRADE_VER-linux-$GOARCH.tar.gz"
|
|
|
|
echo "Downloading $file"
|
|
|
|
|
|
|
|
set +e
|
|
|
|
curl --fail -L https://github.com/coreos/etcd/releases/download/$UPGRADE_VER/$file -o /tmp/$file
|
|
|
|
local result=$?
|
|
|
|
set -e
|
|
|
|
case $result in
|
|
|
|
0) ;;
|
|
|
|
22) return 0
|
|
|
|
;;
|
|
|
|
*) exit $result
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
tar xzvf /tmp/$file -C /tmp/ --strip-components=1
|
|
|
|
mkdir -p ./bin
|
2016-07-15 04:13:07 +03:00
|
|
|
mv /tmp/etcd ./bin/etcd-last-release
|
|
|
|
}
|
|
|
|
|
|
|
|
function fmt_pass {
|
|
|
|
toggle_failpoints disable
|
|
|
|
|
2016-01-18 11:07:09 +03:00
|
|
|
echo "Checking gofmt..."
|
|
|
|
fmtRes=$(gofmt -l -s -d $FMT)
|
|
|
|
if [ -n "${fmtRes}" ]; then
|
|
|
|
echo -e "gofmt checking failed:\n${fmtRes}"
|
|
|
|
exit 255
|
|
|
|
fi
|
2014-10-21 11:17:36 +04:00
|
|
|
|
2016-01-18 11:07:09 +03:00
|
|
|
echo "Checking govet..."
|
|
|
|
vetRes=$(go vet $TEST)
|
2015-08-27 23:23:33 +03:00
|
|
|
if [ -n "${vetRes}" ]; then
|
2016-01-18 11:07:09 +03:00
|
|
|
echo -e "govet checking failed:\n${vetRes}"
|
2015-08-27 23:23:33 +03:00
|
|
|
exit 255
|
|
|
|
fi
|
2015-02-18 00:15:48 +03:00
|
|
|
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Checking 'go tool vet -shadow'..."
|
2016-01-18 11:07:09 +03:00
|
|
|
for path in $FMT; do
|
2016-06-15 00:36:35 +03:00
|
|
|
if [ "${path##*.}" != "go" ]; then
|
|
|
|
path="${path}/*.go"
|
|
|
|
fi
|
2016-01-18 11:07:09 +03:00
|
|
|
vetRes=$(go tool vet -shadow ${path})
|
|
|
|
if [ -n "${vetRes}" ]; then
|
2016-05-11 09:05:58 +03:00
|
|
|
echo -e "govet -shadow checking ${path} failed:\n${vetRes}"
|
2016-01-18 11:07:09 +03:00
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2017-03-03 22:22:51 +03:00
|
|
|
echo "Checking documentation style..."
|
|
|
|
# eschew you
|
|
|
|
yous=`find . -name \*.md | xargs egrep --color "[Yy]ou[r]?[ '.,;]" | grep -v /v2/ || true`
|
|
|
|
if [ ! -z "$yous" ]; then
|
|
|
|
echo -e "found 'you' in documentation:\n${yous}"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
2016-04-08 08:09:04 +03:00
|
|
|
if which goword >/dev/null; then
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Checking goword..."
|
2016-04-08 08:09:04 +03:00
|
|
|
# get all go files to process
|
|
|
|
gofiles=`find $FMT -iname '*.go' 2>/dev/null`
|
|
|
|
# ignore tests and protobuf files
|
|
|
|
gofiles=`echo ${gofiles} | sort | uniq | sed "s/ /\n/g" | egrep -v "(\\_test.go|\\.pb\\.go)"`
|
|
|
|
# only check for broken exported godocs
|
|
|
|
gowordRes=`goword -use-spell=false ${gofiles} | grep godoc-export | sort`
|
|
|
|
if [ ! -z "$gowordRes" ]; then
|
|
|
|
echo -e "goword checking failed:\n${gowordRes}"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
else
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Skipping goword..."
|
2016-04-08 08:09:04 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if which gosimple >/dev/null; then
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Checking gosimple..."
|
2017-03-15 00:45:03 +03:00
|
|
|
gosimpleResult=`gosimple ${STATIC_ANALYSIS_PATHS} 2>&1 || true`
|
|
|
|
if [ ! -n "${gosimpleResult}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
# TODO: resolve these after go1.8 migration
|
|
|
|
SIMPLE_CHECK_MASK="S(1024)"
|
|
|
|
if egrep -v "$SIMPLE_CHECK_MASK" "${gosimpleResult}"; then
|
|
|
|
echo -e "gosimple checking ${path} failed:\n${gosimpleResult}"
|
2017-03-02 08:38:39 +03:00
|
|
|
exit 255
|
2017-03-15 00:45:03 +03:00
|
|
|
else
|
|
|
|
echo -e "gosimple warning:\n${gosimpleResult}"
|
2017-03-02 08:38:39 +03:00
|
|
|
fi
|
2016-04-08 08:09:04 +03:00
|
|
|
else
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Skipping gosimple..."
|
2016-04-08 08:09:04 +03:00
|
|
|
fi
|
2016-12-09 22:16:03 +03:00
|
|
|
|
2016-04-08 08:09:04 +03:00
|
|
|
if which unused >/dev/null; then
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Checking unused..."
|
2017-03-07 00:38:02 +03:00
|
|
|
unusedResult=`unused ${STATIC_ANALYSIS_PATHS} 2>&1 || true`
|
2017-03-02 08:38:39 +03:00
|
|
|
if [ -n "${unusedResult}" ]; then
|
|
|
|
echo -e "unused checking failed:\n${unusedResult}"
|
|
|
|
exit 255
|
|
|
|
fi
|
2016-04-08 08:09:04 +03:00
|
|
|
else
|
2016-05-11 09:05:58 +03:00
|
|
|
echo "Skipping unused..."
|
2016-02-21 14:52:15 +03:00
|
|
|
fi
|
|
|
|
|
2017-03-09 03:21:52 +03:00
|
|
|
if which staticcheck >/dev/null; then
|
2017-03-07 00:38:02 +03:00
|
|
|
echo "Checking staticcheck..."
|
|
|
|
staticcheckResult=`staticcheck ${STATIC_ANALYSIS_PATHS} 2>&1 || true`
|
|
|
|
if [ ! -n "${staticcheckResult}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
# TODO: resolve these after go1.8 migration
|
|
|
|
# See https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck
|
|
|
|
STATIC_CHECK_MASK="SA(1016|1019|2002)"
|
|
|
|
if egrep -v "$STATIC_CHECK_MASK" "${staticcheckResult}"; then
|
|
|
|
echo -e "staticcheck checking ${path} failed:\n${staticcheckResult}"
|
|
|
|
exit 255
|
|
|
|
else
|
|
|
|
echo -e "staticcheck warning:\n${staticcheckResult}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Skipping staticcheck..."
|
|
|
|
fi
|
|
|
|
|
2016-01-18 11:07:09 +03:00
|
|
|
echo "Checking for license header..."
|
2016-10-11 14:53:40 +03:00
|
|
|
licRes=$(for file in $(find . -type f -iname '*.go' ! -path './cmd/*' ! -path './gopath.proto/*'); do
|
2016-01-18 11:07:09 +03:00
|
|
|
head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo -e " ${file}"
|
|
|
|
done;)
|
|
|
|
if [ -n "${licRes}" ]; then
|
|
|
|
echo -e "license header checking failed:\n${licRes}"
|
|
|
|
exit 255
|
|
|
|
fi
|
2016-06-22 23:08:30 +03:00
|
|
|
|
|
|
|
echo "Checking commit titles..."
|
2016-06-29 19:28:53 +03:00
|
|
|
git log --oneline `git merge-base HEAD master`...HEAD | while read l; do
|
2016-06-26 15:54:02 +03:00
|
|
|
commitMsg=`echo "$l" | cut -f2- -d' '`
|
|
|
|
if [[ "$commitMsg" == Merge* ]]; then
|
2016-06-22 23:08:30 +03:00
|
|
|
# ignore "Merge pull" commits
|
|
|
|
continue
|
|
|
|
fi
|
2016-06-26 15:54:02 +03:00
|
|
|
if [[ "$commitMsg" == Revert* ]]; then
|
2016-06-22 23:08:30 +03:00
|
|
|
# ignore revert commits
|
|
|
|
continue
|
|
|
|
fi
|
2016-06-26 15:54:02 +03:00
|
|
|
|
|
|
|
pkgPrefix=`echo "$commitMsg" | cut -f1 -d':'`
|
|
|
|
spaceCommas=`echo "$commitMsg" | sed 's/ /\n/g' | grep -c ',$' || echo 0`
|
|
|
|
commaSpaces=`echo "$commitMsg" | sed 's/,/\n/g' | grep -c '^ ' || echo 0`
|
|
|
|
if [[ `echo $commitMsg | grep -c ":..*"` == 0 || "$commitMsg" == "$pkgPrefix" || "$spaceCommas" != "$commaSpaces" ]]; then
|
|
|
|
echo "$l"...
|
|
|
|
echo "Expected commit title format '<package>{\", \"<package>}: <description>'"
|
2016-06-22 23:08:30 +03:00
|
|
|
echo "Got: $l"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
done
|
2016-01-18 11:07:09 +03:00
|
|
|
}
|
2015-09-15 23:54:20 +03:00
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
function dep_pass {
|
2016-03-17 20:18:35 +03:00
|
|
|
echo "Checking package dependencies..."
|
|
|
|
# don't pull in etcdserver package
|
|
|
|
pushd clientv3 >/dev/null
|
2016-04-25 22:32:58 +03:00
|
|
|
badpkg="(etcdserver|mvcc)"
|
2016-03-17 20:18:35 +03:00
|
|
|
deps=`go list -f '{{ .Deps }}' | sed 's/ /\n/g' | egrep "${badpkg}" | egrep -v "${badpkg}/" || echo ""`
|
|
|
|
popd >/dev/null
|
|
|
|
if [ ! -z "$deps" ]; then
|
|
|
|
echo -e "clientv3 has masked dependencies:\n${deps}"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-01-31 03:05:21 +03:00
|
|
|
function build_cov_pass {
|
|
|
|
out="bin"
|
|
|
|
if [ -n "${BINDIR}" ]; then out="${BINDIR}"; fi
|
2017-03-14 09:58:29 +03:00
|
|
|
go test -c -covermode=set -coverpkg=$PKGS_COMMA -o ${out}/etcd_test
|
|
|
|
go test -tags cov -c -covermode=set -coverpkg=$PKGS_COMMA -o ${out}/etcdctl_test ${REPO_PATH}/etcdctl
|
2017-01-31 03:05:21 +03:00
|
|
|
}
|
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
function compile_pass {
|
2016-06-29 01:03:19 +03:00
|
|
|
echo "Checking build..."
|
|
|
|
go build -v ./tools/...
|
|
|
|
}
|
|
|
|
|
2016-07-15 04:13:07 +03:00
|
|
|
# fail fast on static tests
|
|
|
|
function build_pass {
|
|
|
|
GO_BUILD_FLAGS="-a -v" etcd_build
|
|
|
|
}
|
|
|
|
|
|
|
|
for pass in $PASSES; do
|
2017-01-18 18:48:40 +03:00
|
|
|
${pass}_pass $@
|
2016-07-15 04:13:07 +03:00
|
|
|
done
|
2016-06-21 22:44:11 +03:00
|
|
|
|
2014-09-09 10:06:03 +04:00
|
|
|
echo "Success"
|