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
This commit is contained in:
parent
0d1e001b9c
commit
bb5f694fc5
2 changed files with 10 additions and 2 deletions
10
Makefile
10
Makefile
|
@ -21,6 +21,8 @@ SOURCES ?= $(shell find . -name "*.go" -type f)
|
||||||
|
|
||||||
TAGS ?=
|
TAGS ?=
|
||||||
|
|
||||||
|
TMPDIR := $(shell mktemp -d)
|
||||||
|
|
||||||
ifneq ($(DRONE_TAG),)
|
ifneq ($(DRONE_TAG),)
|
||||||
VERSION ?= $(subst v,,$(DRONE_TAG))
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||||
else
|
else
|
||||||
|
@ -82,7 +84,13 @@ test-vendor:
|
||||||
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
go get -u github.com/kardianos/govendor; \
|
go get -u github.com/kardianos/govendor; \
|
||||||
fi
|
fi
|
||||||
govendor status +outside +unused || exit 1
|
govendor list +unused | tee "$(TMPDIR)/wc-gitea-unused"
|
||||||
|
[ $$(cat "$(TMPDIR)/wc-gitea-unused" | wc -l) -eq 0 ] || echo "Warning: /!\\ Some vendor are not used /!\\"
|
||||||
|
|
||||||
|
govendor list +outside | tee "$(TMPDIR)/wc-gitea-outside"
|
||||||
|
[ $$(cat "$(TMPDIR)/wc-gitea-outside" | wc -l) -eq 0 ] || exit 1
|
||||||
|
|
||||||
|
govendor status || exit 1
|
||||||
|
|
||||||
.PHONY: test-sqlite
|
.PHONY: test-sqlite
|
||||||
test-sqlite: integrations.test
|
test-sqlite: integrations.test
|
||||||
|
|
2
vendor/vendor.json
vendored
2
vendor/vendor.json
vendored
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"ignore": "test",
|
"ignore": "test appengine",
|
||||||
"package": [
|
"package": [
|
||||||
{
|
{
|
||||||
"checksumSHA1": "spqE5xUEPQp8YV67McMTMAUIilY=",
|
"checksumSHA1": "spqE5xUEPQp8YV67McMTMAUIilY=",
|
||||||
|
|
Reference in a new issue