From 308ce8b235c3ef3bce79d86b927f5d849e1adfcc Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Thu, 4 Jan 2018 22:22:53 +0000 Subject: [PATCH 1/4] tests: less bash --- Makefile | 5 +++++ test.sh | 19 ------------------- tests/test_cover.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 tests/test_cover.sh diff --git a/Makefile b/Makefile index 64a989a87..81dceb781 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,14 @@ test_race: @echo "==> Running go test --race" @go test -v -race $(PACKAGES) +test_cover: + @ bash tests/test_cover.sh + test_integrations: @bash test.sh +fmt: + @ go fmt ./... ######################################## ### Formatting, linting, and vetting diff --git a/test.sh b/test.sh index 978b26e1f..e69de29bb 100755 --- a/test.sh +++ b/test.sh @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e -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 -done - -echo "==> Running integration tests (./tests)" -find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; -# tests/test.sh requires that we run the installed cmds, must not be out of date -make install -bash tests/test.sh diff --git a/tests/test_cover.sh b/tests/test_cover.sh new file mode 100644 index 000000000..abbbbe563 --- /dev/null +++ b/tests/test_cover.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +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 +done From de02ab4b3c8fe6c6bc162e0215000e6e94037bb9 Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Thu, 4 Jan 2018 22:31:04 +0000 Subject: [PATCH 2/4] lil fix --- test.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 test.sh diff --git a/test.sh b/test.sh deleted file mode 100755 index e69de29bb..000000000 From 2adef2e8f88822ce660881686cdcacd807f3f427 Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Fri, 5 Jan 2018 00:02:58 +0000 Subject: [PATCH 3/4] less bash in tests --- Makefile | 10 ++++++++-- tests/test_cover.sh | 0 2 files changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/test_cover.sh diff --git a/Makefile b/Makefile index 81dceb781..f44dc5e26 100644 --- a/Makefile +++ b/Makefile @@ -82,11 +82,17 @@ test_race: @echo "==> Running go test --race" @go test -v -race $(PACKAGES) +### three tests tested by Jenkins test_cover: @ bash tests/test_cover.sh -test_integrations: - @bash test.sh +test_app: + # test the counter using a go test script + @ bash tests/test_app/test.sh + +test_cli: + # test the cli against the examples in the tutorial at tendermint.com + @ bash tests/test_cli/test.sh fmt: @ go fmt ./... diff --git a/tests/test_cover.sh b/tests/test_cover.sh old mode 100644 new mode 100755 From e19cedc4b45c190630ea622f2738786a1bbc10cb Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Fri, 18 May 2018 12:03:57 -0400 Subject: [PATCH 4/4] tests: more smoothness --- .circleci/config.yml | 10 +++++----- Makefile | 2 +- tests/test.sh | 11 ----------- 3 files changed, 6 insertions(+), 17 deletions(-) delete mode 100755 tests/test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index d147c6ac2..3ff0464e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ jobs: paths: - /go/src/github.com/tendermint/abci - test_integration: + test_apps: <<: *defaults steps: - attach_workspace: @@ -56,10 +56,10 @@ jobs: - restore_cache: key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: - name: Run integration tests + name: Run apps tests command: | export PATH="$GOBIN:$PATH" - bash tests/test.sh + bash tests/test_app/test.sh test_cover: <<: *defaults @@ -111,9 +111,9 @@ workflows: - test_cover: requires: - setup_dependencies - - test_integration: + - test_apps: requires: - setup_dependencies - upload_coverage: requires: - - test_integration + - test_cover diff --git a/Makefile b/Makefile index f44dc5e26..13a9547ce 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ test_race: test_cover: @ bash tests/test_cover.sh -test_app: +test_apps: # test the counter using a go test script @ bash tests/test_app/test.sh diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index 416145fc9..000000000 --- a/tests/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash -set -e - -# test the counter using a go test script -bash tests/test_app/test.sh - -# test the cli against the examples in the tutorial at tendermint.com -# TODO: make these less fragile -# bash tests/test_cli/test.sh - -