Browse Source

fixup tests

pull/1780/head
Ethan Buchman 7 years ago
parent
commit
fb612e5a7b
6 changed files with 29 additions and 14 deletions
  1. +10
    -4
      Makefile
  2. +1
    -1
      circle.yml
  3. +2
    -2
      cmd/abci-cli/abci-cli.go
  4. +10
    -1
      cmd/abci-cli/main.go
  5. +5
    -5
      test.sh
  6. +1
    -1
      tests/test_app/app.go

+ 10
- 4
Makefile View File

@ -36,12 +36,18 @@ dist:
@ bash scripts/publish.sh
# 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 {} \;
@ echo "==> Running unit tests"
@ echo "==> Running go test"
@ 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:
@ go fmt ./...


+ 1
- 1
circle.yml View File

@ -16,7 +16,7 @@ checkout:
test:
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:
- cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
- cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}"

+ 2
- 2
cmd/abci-cli/abci-cli.go View File

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


+ 10
- 1
cmd/abci-cli/main.go View File

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

+ 5
- 5
test.sh View File

@ -5,11 +5,11 @@ echo "" > coverage.txt
echo "==> Running unit tests"
for d in $(go list ./... | grep -v vendor); do
go test -race -coverprofile=profile.out -covermode=atomic "$d"
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
go test -race -coverprofile=profile.out -covermode=atomic "$d"
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
echo "==> Running integration tests (./tests)"


+ 1
- 1
tests/test_app/app.go View File

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


Loading…
Cancel
Save