diff --git a/.circleci/config.yml b/.circleci/config.yml index a45f7132e4c..2dc30af5b02 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -224,7 +224,7 @@ jobs: test-contracts: docker: - - image: circleci/node:10.16.3 + - image: circleci/node:16 - image: trufflesuite/ganache-cli:latest command: ['--port=8555', '-a', '100', '-l', '8000000'] steps: @@ -265,7 +265,7 @@ jobs: # uses medium (2vcpu/4gb) by default resource_class: medium docker: - - image: circleci/node:14.17.3 + - image: circleci/node:16 - image: trufflesuite/ganache-cli:latest command: ['--port=8546', '-a', '50', '-l', '8000000'] steps: diff --git a/contracts/scripts/call-function.sh b/contracts/scripts/call-function.sh index 1fd76ab146f..b86be23c12d 100755 --- a/contracts/scripts/call-function.sh +++ b/contracts/scripts/call-function.sh @@ -5,6 +5,6 @@ set -e # Usage: call-function.sh contractName functionName -node_modules/.bin/truffle console << EOF +node_modules/.bin/truffle console < instance.$2.call()).then((value) => console.log("Function returned: " + value)) EOF diff --git a/contracts/scripts/circleci-test.sh b/contracts/scripts/circleci-test.sh index 631f2f428bb..81d15ef0514 100755 --- a/contracts/scripts/circleci-test.sh +++ b/contracts/scripts/circleci-test.sh @@ -13,16 +13,12 @@ sh ./scripts/lint.sh printf '\nSTART Truffle tests:\n\n' -if [ $# -eq 0 ] - then - node_modules/.bin/truffle test --network test_local -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ] - then - node_modules/.bin/truffle test --verbose-rpc --network test_local -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ] - then - node_modules/.bin/truffle test --verbose-rpc $2 --network test_local +if [ $# -eq 0 ]; then + node_modules/.bin/truffle test --network test_local +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ]; then + node_modules/.bin/truffle test --verbose-rpc --network test_local +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ]; then + node_modules/.bin/truffle test --verbose-rpc $2 --network test_local else node_modules/.bin/truffle test $1 --network test_local fi - diff --git a/contracts/scripts/lint.sh b/contracts/scripts/lint.sh index 64255c8f517..35fb4e8f530 100755 --- a/contracts/scripts/lint.sh +++ b/contracts/scripts/lint.sh @@ -17,5 +17,3 @@ printf 'START Solium lint' npm run solidity-lint printf '\nEND Solium lint' printline - - diff --git a/contracts/scripts/truffle-test.sh b/contracts/scripts/truffle-test.sh index c37427b0a73..3470b19ef15 100755 --- a/contracts/scripts/truffle-test.sh +++ b/contracts/scripts/truffle-test.sh @@ -12,7 +12,7 @@ COMMENT # start ganache container, # kill old container instance if tear down did not complete -if docker ps | grep 'audius_ganache_cli_test' > /dev/null; then +if docker ps | grep 'audius_ganache_cli_test' >/dev/null; then # killing the container seems to be faster than restarting printf 'Remove old containers and build artifacts\n' docker rm -f audius_ganache_cli_test @@ -31,15 +31,12 @@ docker run --name audius_ganache_cli_test -d -p 8555:8545 trufflesuite/ganache-c ./scripts/lint.sh # run truffle tests -if [ $# -eq 0 ] - then - node_modules/.bin/truffle test --network=test_local -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ] - then - node_modules/.bin/truffle test --network=test_local --verbose-rpc -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ] - then - node_modules/.bin/truffle test --network=test_local --verbose-rpc $2 +if [ $# -eq 0 ]; then + node_modules/.bin/truffle test --network=test_local +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ]; then + node_modules/.bin/truffle test --network=test_local --verbose-rpc +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ]; then + node_modules/.bin/truffle test --network=test_local --verbose-rpc $2 else node_modules/.bin/truffle test --network=test_local $1 fi diff --git a/eth-contracts/scripts/lint.sh b/eth-contracts/scripts/lint.sh index 258a45ae77e..9032da615fe 100755 --- a/eth-contracts/scripts/lint.sh +++ b/eth-contracts/scripts/lint.sh @@ -2,7 +2,6 @@ set -e set -o pipefail - < /dev/null; then +if docker ps | grep 'audius_ganache_cli_eth_contracts_test' >/dev/null; then # killing the container seems to be faster than restarting printf 'Remove old containers and build artifacts\n' docker rm -f audius_ganache_cli_eth_contracts_test @@ -36,18 +36,14 @@ docker run --name audius_ganache_cli_eth_contracts_test -d -p 8556:8545 truffles ./node_modules/.bin/truffle compile # run truffle tests -if [ $# -eq 0 ] - then - node_modules/.bin/truffle test test/*.js --network=test_local -elif [ $1 == '--audius-random' ] && [ $# -eq 1 ] - then - node_modules/.bin/truffle test test/random/random.test.js --network=test_local -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ] - then - node_modules/.bin/truffle test test/*.js --network=test_local --verbose-rpc -elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ] - then - node_modules/.bin/truffle test test/*.js --network=test_local --verbose-rpc $2 +if [ $# -eq 0 ]; then + node_modules/.bin/truffle test test/*.js --network=test_local +elif [ $1 == '--audius-random' ] && [ $# -eq 1 ]; then + node_modules/.bin/truffle test test/random/random.test.js --network=test_local +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 1 ]; then + node_modules/.bin/truffle test test/*.js --network=test_local --verbose-rpc +elif [ $1 == '--verbose-rpc' ] && [ $# -eq 2 ]; then + node_modules/.bin/truffle test test/*.js --network=test_local --verbose-rpc $2 else node_modules/.bin/truffle test test/*.js --network=test_local $1 fi