Skip to content

Commit cce4958

Browse files
thinkerouappleboy
authored andcommitted
ci: break when test fail (#1671)
1 parent 98c7ac7 commit cce4958

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ vendor/*
33
coverage.out
44
count.out
55
test
6+
profile.out
7+
tmp.out

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ install: deps
1414
test:
1515
echo "mode: count" > coverage.out
1616
for d in $(TESTFOLDER); do \
17-
$(GO) test -v -covermode=count -coverprofile=profile.out $$d; \
17+
$(GO) test -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \
18+
cat tmp.out; \
19+
if grep -q "^--- FAIL" tmp.out; then \
20+
rm tmp.out; \
21+
exit 1;\
22+
fi; \
1823
if [ -f profile.out ]; then \
1924
cat profile.out | grep -v "mode:" >> coverage.out; \
2025
rm profile.out; \

0 commit comments

Comments
 (0)