Browse Source

run CI tests in docker container

pull/259/head
Ethan Buchman 8 years ago
parent
commit
8fd216b4f6
6 changed files with 31 additions and 22 deletions
  1. +1
    -1
      Makefile
  2. +0
    -2
      circle.yml
  3. +1
    -1
      glide.lock
  4. +5
    -6
      test/Dockerfile
  5. +14
    -0
      test/run_test.sh
  6. +10
    -12
      test/test.sh

+ 1
- 1
Makefile View File

@ -24,7 +24,7 @@ test: build
test_race: build
go test -race `${NOVENDOR}`
test_integrations:
test_integrations:
bash ./test/test.sh
test100: build


+ 0
- 2
circle.yml View File

@ -20,11 +20,9 @@ dependencies:
- sudo service docker start
- go version
- docker version
- "cd $REPO && make get_vendor_deps"
test:
override:
- "cd $REPO && make test_race"
- "cd $REPO && make test_integrations"
post:
- bash <(curl -s https://codecov.io/bash)

+ 1
- 1
glide.lock View File

@ -45,7 +45,7 @@ imports:
- leveldb/table
- leveldb/util
- name: github.com/tendermint/ed25519
version: fdac6641497281ed1cc368687ec6377e96e02b24
version: 1f52c6f8b8a5c7908aff4497c186af344b428925
subpackages:
- extra25519
- edwards25519


+ 5
- 6
test/Dockerfile View File

@ -1,8 +1,7 @@
# Pull base image.
FROM golang:1.5
COPY test/test_libs.sh /
COPY glide.lock /glide.lock
ENV GLIDE /glide.lock
FROM golang:1.6
ENV TENDERMINT_ORG $GOPATH/src/github.com/tendermint/
RUN mkdir -p $TENDERMINT_ORG
COPY . $TENDERMINT_ORG/tendermint
WORKDIR $TENDERMINT_ORG/tendermint

+ 14
- 0
test/run_test.sh View File

@ -0,0 +1,14 @@
#! /bin/bash
echo `pwd`
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "Current branch: $BRANCH"
make get_vendor_deps
make test_race
if [[ "$BRANCH" == "master" || "$BRANCH" == "staging" ]]; then
bash test/test_libs.sh
fi

+ 10
- 12
test/test.sh View File

@ -1,14 +1,12 @@
#! /bin/bash
# integrations test!
# if we pushed to STAGING or MASTER,
# run the integrations tests.
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "Current branch: $BRANCH"
if [[ "$BRANCH" == "master" || "$BRANCH" == "staging" ]]; then
docker build -t tester -f ./test/Dockerfile .
docker run -t tester bash /test_libs.sh
fi
# integrations test
# this is the script run by eg CircleCI.
# It creates a docker container,
# installs the dependencies,
# and runs the tests.
# If we pushed to STAGING or MASTER,
# it will also run the tests for all dependencies
docker build -t tester -f ./test/Dockerfile .
docker run -t tester bash test/run_test.sh

Loading…
Cancel
Save