Skip to content

Commit

Permalink
allow config of the vet flag for go test (#562)
Browse files Browse the repository at this point in the history
* allow config of the vet flag for `go test`

Signed-off-by: Topher Bullock <cbullock@pivotal.io>
  • Loading branch information
topherbullock authored and williammartin committed Mar 7, 2019
1 parent d56ee76 commit 3cd45fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ginkgo/run_watch_and_build_command_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,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)
Expand Down
1 change: 1 addition & 0 deletions ginkgo/testrunner/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func (t *TestRunner) BuildArgs(path string) []string {
"coverpkg",
"tags",
"gcflags",
"vet",
"mod",
}

Expand Down
2 changes: 2 additions & 0 deletions ginkgo/testrunner/test_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var _ = Describe("TestRunner", func() {
"coverpkg": strAddr(""),
"cover": boolAddr(false),
"blockprofilerate": intAddr(100),
"vet": strAddr("off"),
"mod": strAddr("vendor"),
}
tr := testrunner.New(testsuite.TestSuite{}, 1, false, 0, opts, []string{})
Expand All @@ -51,6 +52,7 @@ var _ = Describe("TestRunner", func() {
"-asmflags=a",
"-pkgdir=b",
"-gcflags=c",
"-vet=off",
"-mod=vendor",
}))
})
Expand Down

0 comments on commit 3cd45fa

Please sign in to comment.