Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node API Tests & README update (Stage 1 of Node API Overhaul) #3237

Merged
merged 13 commits into from
Jul 19, 2020
Merged
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