fixup tests

This commit is contained in:
Ethan Buchman
2017-11-27 19:52:06 +00:00
parent c7f54fb56c
commit fb612e5a7b
6 changed files with 29 additions and 14 deletions

View File

@ -36,12 +36,18 @@ dist:
@ bash scripts/publish.sh @ bash scripts/publish.sh
# test.sh requires that we run the installed cmds, must not be out of date # test.sh requires that we run the installed cmds, must not be out of date
test: install test:
@ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
@ echo "==> Running unit tests" @ echo "==> Running go test"
@ go test $(PACKAGES) @ go test $(PACKAGES)
@ echo "==> Running integration tests (./tests)"
@ bash tests/test.sh test_race:
@ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
@ echo "==> Running go test --race"
@go test -v -race $(PACKAGES)
test_integrations:
@ bash test.sh
fmt: fmt:
@ go fmt ./... @ go fmt ./...

View File

@ -16,7 +16,7 @@ checkout:
test: test:
override: override:
- cd $REPO && make get_vendor_deps && make metalinter_test && bash ./test.sh - cd $REPO && make get_vendor_deps && make metalinter_test && make test_integrations
post: post:
- cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt - cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
- cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}" - cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}"

View File

@ -96,10 +96,10 @@ var RootCmd = &cobra.Command{
}, },
} }
func Execute() { func Execute() error {
addGlobalFlags() addGlobalFlags()
addCommands() addCommands()
RootCmd.Execute() return RootCmd.Execute()
} }
func addGlobalFlags() { func addGlobalFlags() {

View File

@ -1,5 +1,14 @@
package main package main
import (
"fmt"
"os"
)
func main() { func main() {
Execute() err := Execute()
if err != nil {
fmt.Print(err)
os.Exit(1)
}
} }

View File

@ -48,7 +48,7 @@ func startClient(abciType string) abcicli.Client {
} }
func setOption(client abcicli.Client, key, value string) { func setOption(client abcicli.Client, key, value string) {
_, err := client.SetOptionSync(key, value) _, err := client.SetOptionSync(types.RequestSetOption{key, value})
if err != nil { if err != nil {
panicf("setting %v=%v: \nerr: %v", key, value, err) panicf("setting %v=%v: \nerr: %v", key, value, err)
} }