github.com/Finschia/ostracon@v1.1.5/tests.mk (about) 1 #!/usr/bin/make -f 2 3 ######################################## 4 ### Testing 5 6 BINDIR ?= $(GOPATH)/bin 7 8 ## required to be run first by most tests 9 build_docker_test_image: 10 docker build -t tester -f ./test/docker/Dockerfile . 11 .PHONY: build_docker_test_image 12 13 ### coverage, app, persistence, and libs tests 14 test_cover: 15 # run the go unit tests with coverage 16 bash test/test_cover.sh 17 .PHONY: test_cover 18 19 test_apps: 20 # run the app tests using bash 21 # requires `abci-cli` and `ostracon` binaries installed 22 bash test/app/test.sh 23 .PHONY: test_apps 24 25 test_abci_apps: 26 bash abci/tests/test_app/test.sh 27 .PHONY: test_abci_apps 28 29 test_abci_cli: 30 # test the cli against the examples in the tutorial at: 31 # ./docs/abci-cli.md 32 # if test fails, update the docs ^ 33 @ bash abci/tests/test_cli/test.sh 34 .PHONY: test_abci_cli 35 36 test_integrations: 37 make build_docker_test_image 38 #make tools # XXX Should remove "make tools": https://github.com/Finschia/ostracon/commit/c6e0d20d4bf062921fcc1eb5b2399447a7d2226e#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52 39 make install 40 make install_abci 41 make test_cover 42 make test_apps 43 make test_abci_apps 44 make test_abci_cli 45 #make test_libs # XXX Should remove "make test_libs": https://github.com/Finschia/ostracon/commit/9b9f1beef3cfc5e501fc494afeb4862bd86482f3#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L114 46 .PHONY: test_integrations 47 48 test_release: 49 @go test -tags release $(PACKAGES) 50 .PHONY: test_release 51 52 test100: 53 @for i in {1..100}; do make test; done 54 .PHONY: test100 55 56 vagrant_test: 57 vagrant up 58 vagrant ssh -c 'make test_integrations' 59 .PHONY: vagrant_test 60 61 ### go tests 62 test: 63 @echo "--> Running go test -- deadlock $(BUILD_TAGS)" 64 @go test -p 1 $(PACKAGES) -tags "deadlock $(BUILD_TAGS)" 65 .PHONY: test 66 67 test_race: 68 @echo "--> Running go test -- race $(BUILD_TAGS)" 69 @go test -p 1 -v -race $(PACKAGES) -tags "$(BUILD_TAGS)" 70 .PHONY: test_race 71 72 test_deadlock: 73 @echo "--> Running go test -- deadlock" 74 @go test -p 1 -v $(PACKAGES) -tags deadlock 75 .PHONY: test_race 76 77 test_tags: 78 @echo "--> Running go test -- $(BUILD_TAGS)" 79 @go test -p 1 $(PACKAGES) -tags "$(BUILD_TAGS)" 80 .PHONY: test 81 82 ### 83 # 84 # WARNING: NOT Support Open API 3. See the CONTRIBUTING.md#RPC Testing 85 # 86 ### 87 # Build hooks for dredd, to skip or add information on some steps 88 build-contract-tests-hooks: 89 ifeq ($(OS),Windows_NT) 90 go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests.exe ./cmd/contract_tests 91 else 92 go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests ./cmd/contract_tests 93 endif 94 .PHONY: build-contract-tests-hooks 95 96 # Run a nodejs tool to test endpoints against a localnet 97 # The command takes care of starting and stopping the network 98 # prerequisites: build-contract-tests-hooks 99 # the build command were not added to let this command run from generic containers or machines. 100 # The binaries should be built beforehand 101 contract-tests: 102 dredd 103 .PHONY: contract-tests