From c77fd32b0cd2320f8c32168174856f49e6713af8 Mon Sep 17 00:00:00 2001 From: Topher Bullock Date: Thu, 14 Feb 2019 13:54:45 -0500 Subject: [PATCH 1/2] allow config of the vet flag for `go test` Signed-off-by: Topher Bullock --- ginkgo/run_watch_and_build_command_flags.go | 1 + ginkgo/testrunner/test_runner.go | 1 + 2 files changed, 2 insertions(+) diff --git a/ginkgo/run_watch_and_build_command_flags.go b/ginkgo/run_watch_and_build_command_flags.go index b7cb7f566..9d62bea38 100644 --- a/ginkgo/run_watch_and_build_command_flags.go +++ b/ginkgo/run_watch_and_build_command_flags.go @@ -140,6 +140,7 @@ func (c *RunWatchAndBuildCommandFlags) flags(mode int) { c.FlagSet.IntVar(c.intSlot("memprofilerate"), "memprofilerate", 0, "Enable more precise (and expensive) memory profiles by setting runtime.MemProfileRate.") c.FlagSet.StringVar(c.stringSlot("outputdir"), "outputdir", "", "Place output files from profiling in the specified directory.") c.FlagSet.BoolVar(c.boolSlot("requireSuite"), "requireSuite", false, "Fail if there are ginkgo tests in a directory but no test suite (missing RunSpecs)") + c.FlagSet.StringVar(c.stringSlot("vet"), "vet", "", "Configure the invocation of 'go vet' to use the comma-separated list of vet checks. If list is 'off', 'go test' does not run 'go vet' at all.") if mode == runMode || mode == watchMode { config.Flags(c.FlagSet, "", false) diff --git a/ginkgo/testrunner/test_runner.go b/ginkgo/testrunner/test_runner.go index a0113e136..decab5cf5 100644 --- a/ginkgo/testrunner/test_runner.go +++ b/ginkgo/testrunner/test_runner.go @@ -119,6 +119,7 @@ func (t *TestRunner) BuildArgs(path string) []string { "coverpkg", "tags", "gcflags", + "vet", } for _, opt := range stringOpts { From 61cbeef281e4bf615c465e61aa27c6c024b8b7c9 Mon Sep 17 00:00:00 2001 From: Topher Bullock Date: Thu, 7 Mar 2019 10:07:02 -0500 Subject: [PATCH 2/2] Add runner test for -vet flag --- ginkgo/testrunner/test_runner_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ginkgo/testrunner/test_runner_test.go b/ginkgo/testrunner/test_runner_test.go index 691917043..92f1c1f68 100644 --- a/ginkgo/testrunner/test_runner_test.go +++ b/ginkgo/testrunner/test_runner_test.go @@ -32,6 +32,7 @@ var _ = Describe("TestRunner", func() { "coverpkg": strAddr(""), "cover": boolAddr(false), "blockprofilerate": intAddr(100), + "vet": strAddr("off"), } tr := testrunner.New(testsuite.TestSuite{}, 1, false, 0, opts, []string{}) @@ -50,6 +51,7 @@ var _ = Describe("TestRunner", func() { "-asmflags=a", "-pkgdir=b", "-gcflags=c", + "-vet=off", })) }) })