From ca6daec8ddbeb6444021fba1171eedd82dd9604e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 21 Oct 2017 10:18:22 +0200 Subject: [PATCH] CI: Check the vendor dir and Gopkg.lock --- run_integration_tests.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/run_integration_tests.go b/run_integration_tests.go index bef9239f8..3782353ab 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -94,6 +94,7 @@ func (env *TravisEnvironment) Prepare() error { "golang.org/x/tools/cmd/cover", "github.com/pierrre/gotestcover", "github.com/NebulousLabs/glyphcheck", + "github.com/golang/dep/cmd/dep", "github.com/restic/rest-server/cmd/rest-server", } @@ -250,6 +251,10 @@ func (env *TravisEnvironment) RunTests() error { return err } + if err = runDep(); err != nil { + return err + } + if err = runGlyphcheck(); err != nil { return err } @@ -409,6 +414,19 @@ func runGofmt() error { return nil } +func runDep() error { + cmd := exec.Command("dep", "ensure", "-no-vendor", "-dry-run") + cmd.Stderr = os.Stderr + cmd.Stdout = os.Stdout + + err := cmd.Run() + if err != nil { + return fmt.Errorf("error running dep: %v\nThis probably means that Gopkg.lock is not up to date, run 'dep ensure' and commit all changes", err) + } + + return nil +} + func runGlyphcheck() error { cmd := exec.Command("glyphcheck", "./cmd/...", "./internal/...") cmd.Stderr = os.Stderr