Skip to content
Snippets Groups Projects
Unverified Commit c47321c4 authored by Benjamin Bollen's avatar Benjamin Bollen
Browse files

circle, tests: restrict circle tests to build + unit tests; minor ongoing fixes

parent 7c6828e6
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,8 @@ dependencies:
override:
- sudo curl -L -o /usr/bin/docker http://s3-external-1.amazonaws.com/circle-downloads/docker-$DOCKER_VERSION-circleci; sudo chmod 0775 /usr/bin/docker; sudo usermod -a -G docker $USER; true
- sudo service docker start
- sudo curl -sSL -o /usr/local/bin/docker-machine https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-linux-x86_64; sudo chmod 0755 /usr/local/bin/docker-machine
- "go get github.com/eris-ltd/eris-cli/cmd/eris; cd ${GOPATH%%:*}/src/github.com/eris-ltd/eris-cli && git checkout origin/$ERIS_CLI_BRANCH && go install ./cmd/eris"
# - sudo curl -sSL -o /usr/local/bin/docker-machine https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-linux-x86_64; sudo chmod 0755 /usr/local/bin/docker-machine
# - "go get github.com/eris-ltd/eris-cli/cmd/eris; cd ${GOPATH%%:*}/src/github.com/eris-ltd/eris-cli && git checkout origin/$ERIS_CLI_BRANCH && go install ./cmd/eris"
- "sudo apt-get update && sudo apt-get install -y libgmp3-dev"
# jq and curl is a dependency for the integration framework
- sudo apt-get install jq curl && go get github.com/Masterminds/glide
......@@ -33,7 +33,7 @@ test:
override:
# We only wish to test our packages not vendored ones
- echo "Running unit tests..." && cd $REPO && glide novendor | xargs go test -tags integration
- echo "Running integration tests..." && cd $REPO && "tests/circle_test.sh" # | tee $CIRCLE_ARTIFACTS/output.log; test ${PIPESTATUS[0]} -eq 0"
# - echo "Running integration tests..." && cd $REPO && "tests/circle_test.sh" # | tee $CIRCLE_ARTIFACTS/output.log; test ${PIPESTATUS[0]} -eq 0"
deployment:
master:
......
......@@ -26,34 +26,6 @@ machine="eris-test-edb-$uuid"
ver=$(cat version/version.go | tail -n 1 | cut -d ' ' -f 4 | tr -d '"')
start=`pwd`
# ----------------------------------------------------------
# Get machine sorted
echo "Setting up a machine for eris-db integration testing"
docker-machine create --driver amazonec2 $machine 1>/dev/null
if [ "$?" -ne 0 ]
then
echo "Failed to create The Machine for eris-db Testing"
exit 1
fi
docker-machine scp tests/docker.sh ${machine}:
if [ "$?" -ne 0 ]
then
echo "Failed to copy the 'docker.sh' script into the container"
exit 1
fi
docker-machine ssh $machine sudo env DOCKER_VERSION=$DOCKER_VERSION '$HOME/docker.sh'
if [ "$?" -ne 0 ]
then
echo "Failed to install Docker client into the container"
exit 1
fi
eval $(docker-machine env $machine)
echo "Machine setup."
echo
docker version
echo
# ----------------------------------------------------------
# Run integration tests
......@@ -66,6 +38,5 @@ test_exit=$?
echo
echo
echo "Cleaning up"
docker-machine rm --force $machine
cd $start
exit $test_exit
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# PURPOSE
# This script will setup docker.
# **NOTE** -- This script is used by Eris to provision test box backends which
# we need to be on a specific version of docker. It will likely be unuseful to
# you.
# If you are looking for a quick and easy way to set up eris on a cloud machin
# please see https://github.com/eris-ltd/common/cloud/chains/setup/setup.sh
# If $DOCKER_VERSION is set then the host will use that.
# -----------------------------------------------------------------------------
# LICENSE
# The MIT License (MIT)
# Copyright (c) 2016-Present Eris Industries, Ltd.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# -----------------------------------------------------------------------------
# REQUIREMENTS
# Ubuntu
# -----------------------------------------------------------------------------
# USAGE
# docker.sh
# -----------------------------------------------------------------------------
# Set defaults
default_docker="1.9.0"
# -----------------------------------------------------------------------------
# Check Ubuntu
#read -p "This script only works on Ubuntu (and does no checking). It may work on some debians. Do you wish to proceed? (y/n) " -n 1 -r
#echo
#if [[ ! $REPLY =~ ^[Yy]$ ]]
#then
# echo "OK. Not doing anything. Bye."
# exit 1
#fi
#echo "You confirmed you are on Ubuntu (or waived compatibility)."
# ----------------------------------------------------------------------------
# Check sudo
if [[ "$USER" != "root" ]]
then
echo "OK. Not doing anything. Bye."
exit 1
fi
echo "Privileges confirmed."
# ----------------------------------------------------------------------------
# Check Docker Version to Install
if [ -z "$DOCKER_VERSION" ]
then
echo "You do not have the \$DOCKER_VERSION set. Trying via hostname (an Eris paradigm)."
export DOCKER_VERSION=$(hostname | cut -d'-' -f4)
if [[ "$DOCKER_VERSION" == `hostname` ]]
then
read -p "I cannot find the Docker Version to Install. You can rerun me with \$DOCKER_VERSION set or use the defaults. Would you like the defaults? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
export DOCKER_VERSION="$default_docker"
fi
fi
fi
echo "Will install Docker for Version: $DOCKER_VERSION"
echo
echo
# ---------------------------------------------------------------------------
# Install Docker Version
echo
wget -qO- https://get.docker.io/gpg | apt-key add -
sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
apt-get update -qq
apt-get install -qqy docker-engine
service docker stop
docker_place=$(which docker)
rm "$docker_place"
curl -sSL --ssl-req -o "$docker_place" https://get.docker.com/builds/Linux/x86_64/docker-$DOCKER_VERSION
chmod 755 "$docker_place"
echo
echo "Docker installed"
# ---------------------------------------------------------------------------
# Restart Docker
echo "Restarting Newly Installed Docker"
echo
service docker start
sleep 3 # boot time
# ---------------------------------------------------------------------------
# Check User Needs to be Added to Docker group
echo
echo
usermod -a -G docker $USER
# ---------------------------------------------------------------------------
# Cleanup
echo
echo
echo "All set"
echo
echo
......@@ -95,7 +95,7 @@ early_exit(){
return 0
fi
echo "There was an error duing setup; keys were not properly imported. Exiting."
echo "There was an error during setup; keys were not properly imported. Exiting."
if [ "$was_running" -eq 0 ]
then
if [ "$ci" = true ]
......@@ -175,8 +175,8 @@ start_chain(){
# set addresses from participants
query1=". | ."$uuid"_participant_000.address"
participant_000_address=$(cat $chains_dir/$uuid/accounts.json | jq $query1)
participant_001_address=$(cat $chains_dir/$uuid/accounts.json | jq '. | ."$uuid"_participant_001.address')
participant_000_address=$(cat $chains_dir/$uuid/addresses.csv | grep "participant_000" | cut -d ',' -f 1)
participant_001_address=$(cat $chains_dir/$uuid/addresses.csv | grep "participant_000" | cut -d ',' -f 1)
echo "participant0 address:" $participant_000_address
echo "participant1 address:" $participant_001_address
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment