From fc09081cc2dc7e743ba8a9c060f81f3b801bcb2b Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Tue, 17 Jul 2018 00:51:55 -0400 Subject: Setting up code coverage with codeclimate Signed-off-by: Dave Henderson --- .gitignore | 1 + Makefile | 2 +- circle.yml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 590d21e0..6c439671 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ report.xml ./gomplate *.cid *.iid +*.out diff --git a/Makefile b/Makefile index a6c8b074..ce445dd8 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ $(PREFIX)/bin/$(PKG_NAME)$(call extension,$(GOOS)): $(PREFIX)/bin/$(PKG_NAME)_$( build: $(PREFIX)/bin/$(PKG_NAME)$(call extension,$(GOOS)) test: - $(GO) test -v -race ./... + $(GO) test -v -race -coverprofile=c.out ./... integration: ./bin/gomplate $(GO) test -v -tags=integration \ diff --git a/circle.yml b/circle.yml index b2420ba7..c3ac8aa9 100644 --- a/circle.yml +++ b/circle.yml @@ -9,11 +9,13 @@ jobs: steps: - checkout - run: make build + - run: cc-test-reporter before-build - run: name: make test command: | trap "go-junit-report < $CIRCLE_TEST_REPORTS/go-test.out > $CIRCLE_TEST_REPORTS/report.xml" EXIT make test | tee $CIRCLE_TEST_REPORTS/go-test.out + cc-test-reporter after-build --exit-code $? - run: make lint - run: make integration - store_artifacts: -- cgit v1.2.3