tests: fail when "make mod-check" detects a modified go.mod file

`go mod verify` does not fail when all moduled under vendor/ are
updated. However it does update `go.mod` in case it does not reflect the
downloaded versions.

By adding this additional verification in `make mod-check`, future
updates to vendor/ will require a correct go.mod as well.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-04-20 11:46:01 +02:00 committed by mergify[bot]
parent b3664cd631
commit 22c0baa4b0

View File

@ -52,7 +52,8 @@ go-test:
./scripts/test-go.sh
mod-check:
go mod verify
@echo 'running: go mod verify'
@go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false )
go-lint:
./scripts/lint-go.sh