test: fix docker and apps
This commit is contained in:
parent
0fa34f7f67
commit
e4e70ece3f
|
@ -30,9 +30,9 @@ echo "... testing query with abci-cli"
|
||||||
RESPONSE=`abci-cli query \"$KEY\"`
|
RESPONSE=`abci-cli query \"$KEY\"`
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
A=`echo $RESPONSE | grep 'log: exists'`
|
A=`echo $RESPONSE | grep "$VALUE"`
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
echo "Failed to find 'log: exists' for $KEY. Response:"
|
echo "Failed to find $VALUE for $KEY. Response:"
|
||||||
echo "$RESPONSE"
|
echo "$RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -41,9 +41,9 @@ set -e
|
||||||
# we should not be able to look up the value
|
# we should not be able to look up the value
|
||||||
RESPONSE=`abci-cli query \"$VALUE\"`
|
RESPONSE=`abci-cli query \"$VALUE\"`
|
||||||
set +e
|
set +e
|
||||||
A=`echo $RESPONSE | grep 'log: exists'`
|
A=`echo $RESPONSE | grep $VALUE`
|
||||||
if [[ $? == 0 ]]; then
|
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"
|
echo "$RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -10,10 +10,6 @@ RUN apt-get update && \
|
||||||
ENV REPO $GOPATH/src/github.com/tendermint/tendermint
|
ENV REPO $GOPATH/src/github.com/tendermint/tendermint
|
||||||
WORKDIR $REPO
|
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
|
# Install the vendored dependencies before copying code
|
||||||
# docker caching prevents reinstall on code change!
|
# docker caching prevents reinstall on code change!
|
||||||
ADD glide.yaml glide.yaml
|
ADD glide.yaml glide.yaml
|
||||||
|
@ -21,6 +17,10 @@ ADD glide.lock glide.lock
|
||||||
ADD Makefile Makefile
|
ADD Makefile Makefile
|
||||||
RUN make get_vendor_deps
|
RUN make get_vendor_deps
|
||||||
|
|
||||||
|
# Install the apps
|
||||||
|
ADD scripts scripts
|
||||||
|
RUN bash scripts/install_abci_apps.sh
|
||||||
|
|
||||||
# Now copy in the code
|
# Now copy in the code
|
||||||
COPY . $REPO
|
COPY . $REPO
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,13 @@ pwd
|
||||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
echo "Current branch: $BRANCH"
|
echo "Current branch: $BRANCH"
|
||||||
|
|
||||||
|
# run the go unit tests with coverage
|
||||||
bash test/test_cover.sh
|
bash test/test_cover.sh
|
||||||
|
|
||||||
# run the app tests
|
# run the app tests using bash
|
||||||
bash test/app/test.sh
|
bash test/app/test.sh
|
||||||
|
|
||||||
# run the persistence test
|
# run the persistence tests using bash
|
||||||
bash test/persist/test.sh
|
bash test/persist/test.sh
|
||||||
|
|
||||||
if [[ "$BRANCH" == "master" || $(echo "$BRANCH" | grep "release-") != "" ]]; then
|
if [[ "$BRANCH" == "master" || $(echo "$BRANCH" | grep "release-") != "" ]]; then
|
||||||
|
|
15
test/test.sh
15
test/test.sh
|
@ -12,18 +12,25 @@ echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
|
||||||
rm -rf "$LOGS_DIR"
|
rm -rf "$LOGS_DIR"
|
||||||
mkdir -p "$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
|
set +u
|
||||||
if [[ "$CIRCLECI" == true ]]; then
|
if [[ "$CIRCLECI" == true ]]; then
|
||||||
set -u
|
|
||||||
echo
|
echo
|
||||||
echo "* [$(date +"%T")] starting rsyslog container"
|
echo "* [$(date +"%T")] starting rsyslog container"
|
||||||
docker rm -f rsyslog || true
|
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
|
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
if [[ "$SKIP_BUILD" == "" ]]; then
|
||||||
echo "* [$(date +"%T")] building docker image"
|
echo
|
||||||
bash "$DIR/docker/build.sh"
|
echo "* [$(date +"%T")] building docker image"
|
||||||
|
bash "$DIR/docker/build.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "* [$(date +"%T")] running go tests and app tests in docker container"
|
echo "* [$(date +"%T")] running go tests and app tests in docker container"
|
||||||
|
|
Loading…
Reference in New Issue