Skip to content

Commit

Permalink
Retry EUnit tests on failure
Browse files Browse the repository at this point in the history
Whole app is retried 2 extra times if it fails.

Added to *nix Makefile only for now. May not be needed for Windows as this is
for CI flakiness mostly.
  • Loading branch information
nickva committed Jul 29, 2019
1 parent f37e1e7 commit 220462a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Expand Up @@ -170,8 +170,18 @@ eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell
eunit: couch
@$(REBAR) setup_eunit 2> /dev/null
@for dir in $(subdirs); do \
$(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir || exit 1; \
done
tries=0; \
while true; do \
$(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir ; \
if [ $$? -eq 0 ]; then \
break; \
else \
let "tries=tries+1"; \
[ $$tries -gt 2 ] && exit 1; \
fi \
done \
done


.PHONY: exunit
# target: exunit - Run ExUnit tests
Expand Down

0 comments on commit 220462a

Please sign in to comment.