Skip to content

Commit bb5f694

Browse files
sapkbkcsoft
authored andcommitted
Improve govendor testing (#1623)
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor. - Remove appengine import
1 parent 0d1e001 commit bb5f694

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ SOURCES ?= $(shell find . -name "*.go" -type f)
2121

2222
TAGS ?=
2323

24+
TMPDIR := $(shell mktemp -d)
25+
2426
ifneq ($(DRONE_TAG),)
2527
VERSION ?= $(subst v,,$(DRONE_TAG))
2628
else
@@ -82,7 +84,13 @@ test-vendor:
8284
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
8385
go get -u github.com/kardianos/govendor; \
8486
fi
85-
govendor status +outside +unused || exit 1
87+
govendor list +unused | tee "$(TMPDIR)/wc-gitea-unused"
88+
[ $$(cat "$(TMPDIR)/wc-gitea-unused" | wc -l) -eq 0 ] || echo "Warning: /!\\ Some vendor are not used /!\\"
89+
90+
govendor list +outside | tee "$(TMPDIR)/wc-gitea-outside"
91+
[ $$(cat "$(TMPDIR)/wc-gitea-outside" | wc -l) -eq 0 ] || exit 1
92+
93+
govendor status || exit 1
8694

8795
.PHONY: test-sqlite
8896
test-sqlite: integrations.test

vendor/vendor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"comment": "",
3-
"ignore": "test",
3+
"ignore": "test appengine",
44
"package": [
55
{
66
"checksumSHA1": "spqE5xUEPQp8YV67McMTMAUIilY=",

0 commit comments

Comments
 (0)