Skip to content

Commit

Permalink
Merge pull request #3237 from Daniel-VDM/pr-rpc-tests
Browse files Browse the repository at this point in the history
Node API Tests & README update (Stage 1 of Node API Overhaul)
  • Loading branch information
Leo Chen authored Jul 19, 2020
2 parents 2201480 + ee18c43 commit 25a236a
Show file tree
Hide file tree
Showing 12 changed files with 362 additions and 332 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
sudo: required
services:
- docker
language: go
go:
- 1.14
go_import_path: github.com/harmony-one/harmony
env:
- TEST="go build -v ./..."
- TEST="./scripts/travis_checker.sh"
- TEST="./scripts/travis_node_checker.sh"
install:
- export GO111MODULE=on
- export GOPATH=$HOME/gopath
Expand All @@ -21,11 +28,10 @@ install:
- cd ../harmony
- go get -v ./...
- scripts/install_build_tools.sh
- chmod +x scripts/travis_checker.sh
- chmod +x scripts/travis_node_checker.sh
script:
- go build -v ./...
- ./scripts/travis_checker.sh
notifications:
slack: harmonyone:gggCd1QQopsQAW8JYgBWiH7M
- ${TEST}
after_success:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ WORKDIR ${HMY_PATH}/harmony

RUN eval "$(~/bin/gimme ${GIMME_GO_VERSION})" ; scripts/install_build_tools.sh

RUN eval "$(~/bin/gimme ${GIMME_GO_VERSION})" ; scripts/go_executable_build.sh
RUN eval "$(~/bin/gimme ${GIMME_GO_VERSION})" ; scripts/go_executable_build.sh -S

RUN cd ${HMY_PATH}/go-sdk && make -j8 && cp hmy /root/bin

Expand Down
50 changes: 43 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,64 @@ export LIBRARY_PATH:=$(LD_LIBRARY_PATH)
export DYLD_FALLBACK_LIBRARY_PATH:=$(LD_LIBRARY_PATH)
export GO111MODULE:=on

.PHONY: all libs exe test
.PHONY: all help libs exe race trace-pointer debug debug-kill test test-go test-api test-api-attach linux_static

all: libs
./scripts/go_executable_build.sh -S
bash ./scripts/go_executable_build.sh -S

help:
@echo "all - build the harmony binary & bootnode along with the MCL & BLS libs (if necessary)"
@echo "libs - build only the MCL & BLS libs (if necessary) "
@echo "exe - build the harmony binary & bootnode"
@echo "race - build the harmony binary & bootnode with race condition checks"
@echo "trace-pointer - build the harmony binary & bootnode with pointer analysis"
@echo "debug - start a localnet with 2 shards (s0 rpc endpoint = localhost:9599; s1 rpc endpoint = localhost:9598)"
@echo "debug-kill - force kill the localnet"
@echo "clean - remove node files & logs created by localnet"
@echo "test - run the entire test suite (go test & Node API test)"
@echo "test-go - run the go test (with go lint, fmt, imports, mod, and generate checks)"
@echo "test-api - run the Node API test"
@echo "test-api-attach - attach onto the Node API testing docker container for inspection"
@echo "linux_static - static build the harmony binary & bootnode along with the MCL & BLS libs (for linux)"

libs:
make -C $(TOP)/mcl -j8
make -C $(TOP)/bls BLS_SWAP_G=1 -j8

exe:
./scripts/go_executable_build.sh -S
bash ./scripts/go_executable_build.sh -S

race:
./scripts/go_executable_build.sh -r
bash ./scripts/go_executable_build.sh -r

trace-pointer:
./scripts/go_executable_build.sh -t
bash ./scripts/go_executable_build.sh -t

debug:
bash ./test/debug.sh

debug-kill:
bash ./test/kill_node.sh

clean:
rm -rf ./tmp_log*
rm -rf ./.dht*
rm -rf ./db-*
rm -f ./*.rlp

test:
./test/debug.sh
bash ./test/all.sh

test-go:
bash ./test/go.sh

test-api:
bash ./test/api.sh run

test-api-attach:
bash ./test/api.sh attach

linux_static:
make -C $(TOP)/mcl -j8
make -C $(TOP)/bls minimised_static BLS_SWAP_G=1 -j8
./scripts/go_executable_build.sh -s
bash ./scripts/go_executable_build.sh -s
Loading

0 comments on commit 25a236a

Please sign in to comment.