Contributor app tests #143
@ -26,10 +26,7 @@
|
|||||||
"publish:minor": "aragon apm publish minor",
|
"publish:minor": "aragon apm publish minor",
|
||||||
"publish:major": "aragon apm publish major",
|
"publish:major": "aragon apm publish major",
|
||||||
"versions": "aragon apm versions",
|
"versions": "aragon apm versions",
|
||||||
"test": "aragon contracts test",
|
"test": "aragon contracts test"
|
||||||
"test:gas": "GAS_REPORTER=true npm test",
|
|
||||||
"coverage": "SOLIDITY_COVERAGE=true npm run ganache-cli:test",
|
|
||||||
"ganache-cli:test": "../../scripts/ganache-cli.sh"
|
|
||||||
},
|
},
|
||||||
"keywords": []
|
"keywords": []
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
"publish:minor": "aragon apm publish minor",
|
"publish:minor": "aragon apm publish minor",
|
||||||
"publish:major": "aragon apm publish major",
|
"publish:major": "aragon apm publish major",
|
||||||
"versions": "aragon apm versions",
|
"versions": "aragon apm versions",
|
||||||
"test": "aragon contracts test",
|
"test": "aragon contracts test"
|
||||||
"test:gas": "GAS_REPORTER=true npm test",
|
|
||||||
"coverage": "SOLIDITY_COVERAGE=true npm run ganache-cli:test",
|
|
||||||
"ganache-cli:test": "../../scripts/ganache-cli.sh"
|
|
||||||
},
|
},
|
||||||
"keywords": []
|
"keywords": []
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
"publish:minor": "aragon apm publish minor",
|
"publish:minor": "aragon apm publish minor",
|
||||||
"publish:major": "aragon apm publish major",
|
"publish:major": "aragon apm publish major",
|
||||||
"versions": "aragon apm versions",
|
"versions": "aragon apm versions",
|
||||||
"test": "aragon contracts test",
|
"test": "aragon contracts test"
|
||||||
"test:gas": "GAS_REPORTER=true npm test",
|
|
||||||
"coverage": "SOLIDITY_COVERAGE=true npm run ganache-cli:test",
|
|
||||||
"ganache-cli:test": "../../scripts/ganache-cli.sh"
|
|
||||||
},
|
},
|
||||||
"keywords": []
|
"keywords": []
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
"publish:minor": "aragon apm publish minor",
|
"publish:minor": "aragon apm publish minor",
|
||||||
"publish:major": "aragon apm publish major",
|
"publish:major": "aragon apm publish major",
|
||||||
"versions": "aragon apm versions",
|
"versions": "aragon apm versions",
|
||||||
"test": "aragon contracts test",
|
"test": "aragon contracts test"
|
||||||
"test:gas": "GAS_REPORTER=true npm test",
|
|
||||||
"coverage": "SOLIDITY_COVERAGE=true npm run ganache-cli:test",
|
|
||||||
"ganache-cli:test": "../../scripts/ganache-cli.sh"
|
|
||||||
},
|
},
|
||||||
"keywords": []
|
"keywords": []
|
||||||
}
|
}
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Exit script as soon as a command fails.
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
# Executes cleanup function at script exit.
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
# Kill the RPC instance that we started (if we started one and if it's still running).
|
|
||||||
if [ -n "$rpc_pid" ] && ps -p $rpc_pid > /dev/null; then
|
|
||||||
kill -9 $rpc_pid
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_coverage_variables() {
|
|
||||||
PORT=${PORT-8555}
|
|
||||||
BALANCE=${BALANCE-100000}
|
|
||||||
GAS_LIMIT=${GAS_LIMIT-0xfffffffffff}
|
|
||||||
NETWORK_ID=${NETWORK_ID-16}
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_testing_variables() {
|
|
||||||
PORT=${PORT-8545}
|
|
||||||
BALANCE=${BALANCE-100000}
|
|
||||||
GAS_LIMIT=${GAS_LIMIT-8000000}
|
|
||||||
NETWORK_ID=${NETWORK_ID-15}
|
|
||||||
}
|
|
||||||
|
|
||||||
start_ganache() {
|
|
||||||
echo "Starting ganache-cli..."
|
|
||||||
npx ganache-cli -i ${NETWORK_ID} -l ${GAS_LIMIT} -e ${BALANCE} -p ${PORT} > /dev/null &
|
|
||||||
rpc_pid=$!
|
|
||||||
sleep 3
|
|
||||||
echo "Running ganache-cli with pid ${rpc_pid} in port ${PORT}"
|
|
||||||
}
|
|
||||||
|
|
||||||
start_testrpc() {
|
|
||||||
echo "Starting testrpc-sc..."
|
|
||||||
npx testrpc-sc -i ${NETWORK_ID} -l ${GAS_LIMIT} -e ${BALANCE} -p ${PORT} > /dev/null &
|
|
||||||
rpc_pid=$!
|
|
||||||
sleep 3
|
|
||||||
echo "Running testrpc-sc with pid ${rpc_pid} in port ${PORT}"
|
|
||||||
}
|
|
||||||
|
|
||||||
measure_coverage() {
|
|
||||||
echo "Measuring coverage..."
|
|
||||||
npx solidity-coverage "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
run_tests() {
|
|
||||||
echo "Running tests..."
|
|
||||||
npx aragon contracts test --network rpc "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$SOLIDITY_COVERAGE" = true ]; then
|
|
||||||
setup_coverage_variables
|
|
||||||
start_testrpc
|
|
||||||
measure_coverage
|
|
||||||
else
|
|
||||||
setup_testing_variables
|
|
||||||
start_ganache
|
|
||||||
run_tests
|
|
||||||
fi
|
|
Loading…
x
Reference in New Issue
Block a user