From b80baa80021b993ba21f3afe041d5cd0fc9b015b Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 13 Feb 2018 11:54:22 +0100 Subject: Run EndToEnd tests on circle, too. --- circle.yml | 12 +++--------- scripts/tests.sh | 30 +++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/circle.yml b/circle.yml index eb772d9b..94c711b0 100644 --- a/circle.yml +++ b/circle.yml @@ -93,7 +93,7 @@ jobs: name: Install build dependencies command: | apt-get -qq update - apt-get -qy install ccache cmake libboost-all-dev libz3-dev + apt-get -qy install ccache cmake libboost-all-dev libz3-dev libleveldb1v5 - run: name: Init submodules command: | @@ -114,16 +114,10 @@ jobs: key: ccache-{{ arch }}-{{ .Branch }} paths: - ~/.ccache - - run: - name: Commandline tests - command: test/cmdlineTests.sh - run: mkdir -p test_results - run: - name: Test without optimizer (exclude IPC tests) - command: build/test/soltest --logger=JUNIT,test_suite,test_results/no_opt.xml -- --no-ipc - - run: - name: Test with optimizer (exclude IPC tests) - command: build/test/soltest --logger=JUNIT,test_suite,test_results/opt.xml -- --optimize --no-ipc + name: Tests + command: scripts/tests.sh --junit_report test_results - store_test_results: path: test_results/ - store_artifacts: diff --git a/scripts/tests.sh b/scripts/tests.sh index 2b47c254..d414643b 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -30,6 +30,20 @@ set -e REPO_ROOT="$(dirname "$0")"/.. +if [ "$1" = --junit_report ] +then + if [ -z "$2" ] + then + echo "Usage: $0 [--junit_report ]" + exit 1 + fi + testargs_no_opt="--logger=JUNIT,test_suite,$2/no_opt.xml" + testargs_opt="--logger=JUNIT,test_suite,$2/opt.xml" +else + testargs_no_opt='' + testargs_opt='' +fi + echo "Running commandline tests..." "$REPO_ROOT/test/cmdlineTests.sh" @@ -42,9 +56,15 @@ elif [ -z $CI ]; then ETH_PATH="eth" else mkdir -p /tmp/test - # Update hash below if binary is changed. - wget -q -O /tmp/test/eth https://github.com/ethereum/cpp-ethereum/releases/download/solidityTester/eth_byzantium2 - test "$(shasum /tmp/test/eth)" = "4dc3f208475f622be7c8e53bee720e14cd254c6f /tmp/test/eth" + ETH_BINARY=eth_byzantium_artful + ETH_HASH="e527dd3e3dc17b983529dd7dcfb74a0d3a5aed4e" + if grep -i trusty /etc/lsb-release >/dev/null 2>&1 + then + ETH_BINARY=eth_byzantium2 + ETH_HASH="4dc3f208475f622be7c8e53bee720e14cd254c6f" + fi + wget -q -O /tmp/test/eth https://github.com/ethereum/cpp-ethereum/releases/download/solidityTester/$ETH_BINARY + test "$(shasum /tmp/test/eth)" = "$ETH_HASH /tmp/test/eth" sync chmod +x /tmp/test/eth sync # Otherwise we might get a "text file busy" error @@ -68,9 +88,9 @@ sleep 2 # And then run the Solidity unit-tests (once without optimization, once with), # pointing to that IPC endpoint. echo "--> Running tests without optimizer..." - "$REPO_ROOT"/build/test/soltest --show-progress -- --ipcpath /tmp/test/geth.ipc && \ + "$REPO_ROOT"/build/test/soltest --show-progress $testargs_no_opt -- --ipcpath /tmp/test/geth.ipc && \ echo "--> Running tests WITH optimizer..." && \ - "$REPO_ROOT"/build/test/soltest --show-progress -- --optimize --ipcpath /tmp/test/geth.ipc + "$REPO_ROOT"/build/test/soltest --show-progress $testargs_opt -- --optimize --ipcpath /tmp/test/geth.ipc ERROR_CODE=$? pkill "$ETH_PID" || true sleep 4 -- cgit