Skip to content

Commit

Permalink
ci: break when test fail (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou authored and appleboy committed Dec 5, 2018
1 parent 98c7ac7 commit cce4958
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ vendor/*
coverage.out
count.out
test
profile.out
tmp.out
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ install: deps
test:
echo "mode: count" > coverage.out
for d in $(TESTFOLDER); do \
$(GO) test -v -covermode=count -coverprofile=profile.out $$d; \
$(GO) test -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \
cat tmp.out; \
if grep -q "^--- FAIL" tmp.out; then \
rm tmp.out; \
exit 1;\
fi; \
if [ -f profile.out ]; then \
cat profile.out | grep -v "mode:" >> coverage.out; \
rm profile.out; \
Expand Down

0 comments on commit cce4958

Please sign in to comment.