Skip to content

Commit d15fc0a

Browse files
committed
Fix makefiles so we don't try to test and generate coverage for helpers.
1 parent 536dc6c commit d15fc0a

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test:
2020
@echo "Testing Vault store"
2121
cd store/vault && $(MAKE) test
2222
@echo "Testing main module"
23-
go test ./... -count=1 -coverprofile=cover.out
23+
go test github.com/davepgreene/go-db-credential-refresh/driver -count=1 -coverprofile=cover.out
2424

2525
lint: lint-setup
2626
@echo "Linting AWS RDS store"

store/vault/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
MODULE=vault
22

33
include ./../../tools/tools.mk
4+
5+
# Special handling so we're not generating (non) coverage for our helpers or examples
6+
test:
7+
go test github.com/davepgreene/go-db-credential-refresh/store/vault \
8+
github.com/davepgreene/go-db-credential-refresh/store/vault/auth \
9+
github.com/davepgreene/go-db-credential-refresh/store/vault/credentials \
10+
-count=1 -coverprofile=cover.out

tools/tools.mk

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ else
1414
$(error You must define the GO_BIN variable)
1515
endif
1616

17-
build:
17+
build-default:
1818
go build ./...
1919

20-
test:
20+
test-default:
2121
go test ./... -count=1 -coverprofile=cover.out
2222

23-
bench:
23+
bench-default:
2424
go test ./... -bench -count=1 -coverprofile=cover.out
2525

26-
cover: test
26+
cover-default: test-default
2727
go tool cover -html=cover.out -o "$(GO_BIN)/coverage/$(MODULE).html"
2828

29-
lint:
29+
lint-default:
3030
"$(GO_BIN)/golangci-lint" run ./...
31+
32+
%: %-default
33+
@ true

0 commit comments

Comments
 (0)