Skip to content

Commit

Permalink
fix: CI should use make testcov and use a coverage dir
Browse files Browse the repository at this point in the history
  • Loading branch information
darinspivey committed Jun 1, 2021
1 parent e8e1a66 commit 4553236
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 3 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ jobs:
- run:
name: "Run tests"
command: |
mkdir -p /tmp/artifacts
TF_ACC=1 go test -v -coverprofile=/tmp/artifacts/profile.out -covermode=count ./logdna
go tool cover -html=/tmp/artifacts/profile.out -o /tmp/artifacts/coverage.html
goveralls -coverprofile=/tmp/artifacts/profile.out -service=circleci -repotoken $COVERALLS_REPO_TOKEN
make testcov
goveralls -coverprofile=coverage/coverage.out -service=circleci -repotoken $COVERALLS_REPO_TOKEN
- store_artifacts:
path: /tmp/artifacts
path: coverage
workflows:
update:
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# In case of `make build`
terraform-provider-logdna

coverage.out
coverage
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEST?=$$(go list ./... | grep -v 'vendor')
COVERAGEFILE?=coverage.out
COVERAGEFILE?=coverage/coverage.out
HOSTNAME=logdna.com
NAMESPACE=logdna
NAME=logdna
Expand Down Expand Up @@ -35,7 +35,8 @@ test:
TF_ACC=1 go test -v $(TESTARGS) ./logdna

testcov:
mkdir -p coverage
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -coverprofile $(COVERAGEFILE)
go tool cover -html $(COVERAGEFILE)
go tool cover -html $(COVERAGEFILE) -o $(COVERAGEFILE).html

.PHONY: build release install test testacc testcov

0 comments on commit 4553236

Please sign in to comment.