Browse Source

test: use glide with mintnet/netmon

pull/307/head
Ethan Buchman 8 years ago
parent
commit
de0fc87c1c
4 changed files with 28 additions and 42 deletions
  1. +3
    -0
      test/docker/Dockerfile
  2. +9
    -6
      test/net/test.sh
  3. +13
    -13
      test/test.sh
  4. +3
    -23
      test/test_libs.sh

+ 3
- 0
test/docker/Dockerfile View File

@ -6,6 +6,8 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
jq bsdmainutils vim-common psmisc jq bsdmainutils vim-common psmisc
# Setup tendermint repo with vendored dependencies
# but without code - docker caching prevents reinstall on code change!
ENV REPO $GOPATH/src/github.com/tendermint/tendermint ENV REPO $GOPATH/src/github.com/tendermint/tendermint
WORKDIR $REPO WORKDIR $REPO
ADD glide.yaml glide.yaml ADD glide.yaml glide.yaml
@ -13,6 +15,7 @@ ADD glide.lock glide.lock
ADD Makefile Makefile ADD Makefile Makefile
RUN make get_vendor_deps RUN make get_vendor_deps
# Now copy in the code
COPY . $REPO COPY . $REPO
RUN go install ./cmd/tendermint RUN go install ./cmd/tendermint


+ 9
- 6
test/net/test.sh View File

@ -20,17 +20,20 @@ set -u
export TMHEAD=`git rev-parse --abbrev-ref HEAD` export TMHEAD=`git rev-parse --abbrev-ref HEAD`
export TM_IMAGE="tendermint/tmbase" export TM_IMAGE="tendermint/tmbase"
# not a go repo
# grab network monitor, install mintnet, netmon
set +e set +e
go get github.com/tendermint/network_testing go get github.com/tendermint/network_testing
set -e
# install mintnet, netmon
# TODO: specify branch
go get github.com/tendermint/mintnet go get github.com/tendermint/mintnet
go get github.com/tendermint/netmon go get github.com/tendermint/netmon
set -e
# install vendored deps
cd $GOPATH/src/github.com/tendermint/mintnet
glide install
go install
cd $GOPATH/src/github.com/tendermint/netmon
glide install
go install
cd $GOPATH/src/github.com/tendermint/network_testing cd $GOPATH/src/github.com/tendermint/network_testing
bash experiments/exp_throughput.sh $DATACENTER $VALSETSIZE $BLOCKSIZE $TX_SIZE $NTXS $MACH_PREFIX $RESULTSDIR $CLOUD_PROVIDER bash experiments/exp_throughput.sh $DATACENTER $VALSETSIZE $BLOCKSIZE $TX_SIZE $NTXS $MACH_PREFIX $RESULTSDIR $CLOUD_PROVIDER


+ 13
- 13
test/test.sh View File

@ -8,19 +8,19 @@ echo ""
echo "* building docker image" echo "* building docker image"
bash ./test/docker/build.sh bash ./test/docker/build.sh
echo ""
echo "* running go tests and app tests in docker container"
docker run --name run_test -t tester bash test/run_test.sh
# copy the coverage results out of docker container
docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt .
# test basic network connectivity
# by starting a local testnet and checking peers connect and make blocks
echo ""
echo "* running p2p tests on a local docker network"
bash test/p2p/test.sh tester
#echo ""
#echo "* running go tests and app tests in docker container"
#docker run --name run_test -t tester bash test/run_test.sh
#
## copy the coverage results out of docker container
#docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt .
#
## test basic network connectivity
## by starting a local testnet and checking peers connect and make blocks
#echo ""
#echo "* running p2p tests on a local docker network"
#bash test/p2p/test.sh tester
#
# only run the cloud benchmark for releases # only run the cloud benchmark for releases
BRANCH=`git rev-parse --abbrev-ref HEAD` BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ $(echo "$BRANCH" | grep "release-") != "" ]]; then if [[ $(echo "$BRANCH" | grep "release-") != "" ]]; then


+ 3
- 23
test/test_libs.sh View File

@ -6,27 +6,6 @@ if [[ "$GLIDE" == "" ]]; then
fi fi
# get vendored commit for given lib # get vendored commit for given lib
function parseGlide() {
cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
}
# fetch and checkout vendored dep
function getDep() {
lib=$1
echo "----------------------------------"
echo "Getting $lib ..."
go get -t github.com/tendermint/$lib/...
VENDORED=$(parseGlide $GLIDE $lib)
cd $GOPATH/src/github.com/tendermint/$lib
MASTER=$(git rev-parse origin/master)
if [[ "$VENDORED" != "$MASTER" ]]; then
echo "... VENDORED != MASTER ($VENDORED != $MASTER)"
echo "... Checking out commit $VENDORED"
git checkout $VENDORED &> /dev/null
fi
}
#################### ####################
# libs we depend on # libs we depend on
@ -36,7 +15,9 @@ LIBS_GO_TEST=(go-clist go-common go-config go-crypto go-db go-events go-merkle g
LIBS_MAKE_TEST=(go-rpc go-wire tmsp) LIBS_MAKE_TEST=(go-rpc go-wire tmsp)
for lib in "${LIBS_GO_TEST[@]}"; do for lib in "${LIBS_GO_TEST[@]}"; do
getDep $lib
# checkout vendored version of lib
bash scripts/glide/checkout.sh $GLIDE $lib
echo "Testing $lib ..." echo "Testing $lib ..."
go test --race github.com/tendermint/$lib/... go test --race github.com/tendermint/$lib/...
@ -46,7 +27,6 @@ for lib in "${LIBS_GO_TEST[@]}"; do
fi fi
done done
for lib in "${LIBS_MAKE_TEST[@]}"; do for lib in "${LIBS_MAKE_TEST[@]}"; do
getDep $lib getDep $lib


Loading…
Cancel
Save