Browse Source

test: fix docker and apps

pull/426/head
Ethan Buchman 8 years ago
parent
commit
e4e70ece3f
4 changed files with 22 additions and 14 deletions
  1. +4
    -4
      test/app/dummy_test.sh
  2. +4
    -4
      test/docker/Dockerfile
  3. +3
    -2
      test/run_test.sh
  4. +11
    -4
      test/test.sh

+ 4
- 4
test/app/dummy_test.sh View File

@ -30,9 +30,9 @@ echo "... testing query with abci-cli"
RESPONSE=`abci-cli query \"$KEY\"`
set +e
A=`echo $RESPONSE | grep 'log: exists'`
A=`echo $RESPONSE | grep "$VALUE"`
if [[ $? != 0 ]]; then
echo "Failed to find 'log: exists' for $KEY. Response:"
echo "Failed to find $VALUE for $KEY. Response:"
echo "$RESPONSE"
exit 1
fi
@ -41,9 +41,9 @@ set -e
# we should not be able to look up the value
RESPONSE=`abci-cli query \"$VALUE\"`
set +e
A=`echo $RESPONSE | grep 'log: exists'`
A=`echo $RESPONSE | grep $VALUE`
if [[ $? == 0 ]]; then
echo "Found 'log: exists' for $VALUE when we should not have. Response:"
echo "Found '$VALUE' for $VALUE when we should not have. Response:"
echo "$RESPONSE"
exit 1
fi


+ 4
- 4
test/docker/Dockerfile View File

@ -10,10 +10,6 @@ RUN apt-get update && \
ENV REPO $GOPATH/src/github.com/tendermint/tendermint
WORKDIR $REPO
# Install the apps
ADD scripts/install_abci_apps.sh install_abci_apps.sh
RUN bash install_abci_apps.sh
# Install the vendored dependencies before copying code
# docker caching prevents reinstall on code change!
ADD glide.yaml glide.yaml
@ -21,6 +17,10 @@ ADD glide.lock glide.lock
ADD Makefile Makefile
RUN make get_vendor_deps
# Install the apps
ADD scripts scripts
RUN bash scripts/install_abci_apps.sh
# Now copy in the code
COPY . $REPO


+ 3
- 2
test/run_test.sh View File

@ -6,12 +6,13 @@ pwd
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: $BRANCH"
# run the go unit tests with coverage
bash test/test_cover.sh
# run the app tests
# run the app tests using bash
bash test/app/test.sh
# run the persistence test
# run the persistence tests using bash
bash test/persist/test.sh
if [[ "$BRANCH" == "master" || $(echo "$BRANCH" | grep "release-") != "" ]]; then


+ 11
- 4
test/test.sh View File

@ -12,18 +12,25 @@ echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
rm -rf "$LOGS_DIR"
mkdir -p "$LOGS_DIR"
set +e
echo
echo "* [$(date +"%T")] removing run_test container"
docker rm -vf run_test
set -e
set +u
if [[ "$CIRCLECI" == true ]]; then
set -u
echo
echo "* [$(date +"%T")] starting rsyslog container"
docker rm -f rsyslog || true
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
fi
echo
echo "* [$(date +"%T")] building docker image"
bash "$DIR/docker/build.sh"
if [[ "$SKIP_BUILD" == "" ]]; then
echo
echo "* [$(date +"%T")] building docker image"
bash "$DIR/docker/build.sh"
fi
echo
echo "* [$(date +"%T")] running go tests and app tests in docker container"


Loading…
Cancel
Save