diff --git a/test/all.sh b/test/all.sh new file mode 100644 index 000000000..cda933e3a --- /dev/null +++ b/test/all.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +bash "$DIR/kill_node.sh" +docker pull harmonyone/localnet-test +docker run -it --expose 9000-9999 -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test \ No newline at end of file diff --git a/test/api.sh b/test/api.sh new file mode 100755 index 000000000..1dd47dc20 --- /dev/null +++ b/test/api.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +bash "$DIR/kill_node.sh" + +docker_name="harmony-localnet-test" + +case ${1} in +run) + docker pull harmonyone/localnet-test + docker rm "$docker_name" + docker run -it --name "$docker_name" --expose 9000-9999 -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n -k + ;; +attach) + docker exec -it "$docker_name" /bin/bash + ;; +*) + echo " +Node API tests + +Param: Help: +run Run the Node API tests +attach Attach onto the Node API testing docker image for inspection +" + exit 0 + ;; +esac + diff --git a/test/debug.sh b/test/debug.sh index 03cd9dcf5..b8b267c4b 100755 --- a/test/debug.sh +++ b/test/debug.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash + ./test/kill_node.sh rm -rf tmp_log* rm *.rlp rm -rf .dht* -./test/deploy.sh -D 600000 ./test/configs/local-resharding.txt +scripts/go_executable_build.sh -S || exit 1 # dynamic builds are faster for debug iteration... +./test/deploy.sh -B -D 600000 ./test/configs/local-resharding.txt diff --git a/test/deploy.sh b/test/deploy.sh index ff5b22ea9..2e7f1c13d 100755 --- a/test/deploy.sh +++ b/test/deploy.sh @@ -18,16 +18,18 @@ function cleanup() { } function build() { - pushd ${ROOT} - export GO111MODULE=on - if [[ "$OS" == "Darwin" ]]; then - # MacOS doesn't support static build - scripts/go_executable_build.sh -S - else - # Static build on Linux platform - scripts/go_executable_build.sh -s + if [[ "${NOBUILD}" != "true" ]]; then + pushd ${ROOT} + export GO111MODULE=on + if [[ "$OS" == "Darwin" ]]; then + # MacOS doesn't support static build + scripts/go_executable_build.sh -S + else + # Static build on Linux platform + scripts/go_executable_build.sh -s + fi + popd fi - popd } function setup() { @@ -41,9 +43,7 @@ function setup() { cleanup # Note that the binarys only works on MacOS & Linux - if [[ "${NOBUILD}" != "true" ]]; then - build - fi + build # Create a tmp folder for logs t=$(date +"%Y%m%d-%H%M%S") @@ -156,6 +156,7 @@ SHARDS=2 DRYRUN= NETWORK=localnet VERBOSE=false +NOBUILD=false while getopts "hD:m:s:nBN:v" option; do case ${option} in diff --git a/test/go.sh b/test/go.sh new file mode 100644 index 000000000..1aecb760f --- /dev/null +++ b/test/go.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +docker pull harmonyone/localnet-test +docker run -it -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -- -g