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