|
|
Descriptioncmd/go: add -t flag to 'go get' to download test dependencies
Fixes issue 5126.
Patch Set 1 #
Total comments: 2
Patch Set 2 : diff -r d7db8c804ffa https://code.google.com/p/go #Patch Set 3 : diff -r 2bf4cf823da3 https://code.google.com/p/go #MessagesTotal messages: 19
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
Sign in to reply to this message.
Maybe test dependencies should always be downloaded. Downloading a bit extra isn't a big deal, but missing deps later (e.g. getting on a plane) can be mighty annoying.
Sign in to reply to this message.
I thought that, too. Maybe there should be a flag to *not* download test dependencies? I can see situations where that may be undesired. ("Damn it, I don't want gomock!") On 12 August 2013 08:35, David Symonds <dsymonds@golang.org> wrote: > Maybe test dependencies should always be downloaded. Downloading a bit > extra isn't a big deal, but missing deps later (e.g. getting on a plane) > can be mighty annoying. >
Sign in to reply to this message.
Call it -nomock On Aug 11, 2013 3:49 PM, "Andrew Gerrand" <adg@golang.org> wrote: > I thought that, too. Maybe there should be a flag to *not* download test > dependencies? I can see situations where that may be undesired. ("Damn it, > I don't want gomock!") > > > > > On 12 August 2013 08:35, David Symonds <dsymonds@golang.org> wrote: > >> Maybe test dependencies should always be downloaded. Downloading a bit >> extra isn't a big deal, but missing deps later (e.g. getting on a plane) >> can be mighty annoying. >> > > -- > > --- > You received this message because you are subscribed to the Google Groups > "golang-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > >
Sign in to reply to this message.
I think it's a pretty rare case that a test dependency is large enough to want to avoid even downloading, but I wouldn't object to a flag to opt-out.
Sign in to reply to this message.
I would favor opt-in not opt-out. -rob
Sign in to reply to this message.
On 12 August 2013 10:10, Rob Pike <r@golang.org> wrote: > I would favor opt-in not opt-out. I too favor opt-in, hence this CL. Probably more interesting aspects of this CL to discuss: - should the test dependencies be fetched for the named packages only? Or should test dependencies be fetched for all packages in the dependency tree (test or non-test)? Ie, should I be able to say "go get -t foo" and have "go test ..." always work? - should the test dependencies be installed? This CL merely downloads them, regardless of whether -d is provided.
Sign in to reply to this message.
On 12 August 2013 10:10, Rob Pike <r@golang.org> wrote: > I would favor opt-in not opt-out. Opt-in to downloading test dependencies, or opt-in to not downloading test dependencies?
Sign in to reply to this message.
Opt-in to download test dependencies. -rob
Sign in to reply to this message.
let's start as conservatively as possible: test dependencies should be ignored by default. -t should download but not install test dependencies. -t should download test dependencies for only the named package, not the things it depends on. the goal is that go get -t foo does the minimum amount necessary to make 'go test foo' run a test.
Sign in to reply to this message.
On 12 August 2013 11:13, Russ Cox <rsc@golang.org> wrote: > test dependencies should be ignored by default. > -t should download but not install test dependencies. > -t should download test dependencies for only the named package, > not the things it depends on. > OK, I agree. This is what this CL does.
Sign in to reply to this message.
Thanks for this - I've wanted it for some time. I'm happy with the proposed semantics. On 12 August 2013 02:22, Andrew Gerrand <adg@golang.org> wrote: > > On 12 August 2013 11:13, Russ Cox <rsc@golang.org> wrote: >> >> test dependencies should be ignored by default. >> -t should download but not install test dependencies. >> -t should download test dependencies for only the named package, >> not the things it depends on. > > > OK, I agree. This is what this CL does. > > -- > > --- > You received this message because you are subscribed to the Google Groups > "golang-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >
Sign in to reply to this message.
On a slightly related not, the only thing I really miss currently is the ability to quickly check if all code (including tests) compiles after a change, without running tests. Our tests take quite a while to run and it's really useful to check that all the code at least type checks correctly before running them. On 12 August 2013 09:18, roger peppe <rogpeppe@gmail.com> wrote: > Thanks for this - I've wanted it for some time. > I'm happy with the proposed semantics. > > On 12 August 2013 02:22, Andrew Gerrand <adg@golang.org> wrote: >> >> On 12 August 2013 11:13, Russ Cox <rsc@golang.org> wrote: >>> >>> test dependencies should be ignored by default. >>> -t should download but not install test dependencies. >>> -t should download test dependencies for only the named package, >>> not the things it depends on. >> >> >> OK, I agree. This is what this CL does. >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "golang-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-dev+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >>
Sign in to reply to this message.
go test -run=XXX -v ./... ?
Sign in to reply to this message.
On 12 August 2013 10:28, Andrew Gerrand <adg@golang.org> wrote: > go test -run=XXX -v ./... I can't believe I didn't think of that.
Sign in to reply to this message.
https://codereview.appspot.com/12566046/diff/1/src/cmd/go/doc.go File src/cmd/go/doc.go (right): https://codereview.appspot.com/12566046/diff/1/src/cmd/go/doc.go#newcode251 src/cmd/go/doc.go:251: the tests for the specified packages. also? or only?
Sign in to reply to this message.
https://codereview.appspot.com/12566046/diff/1/src/cmd/go/doc.go File src/cmd/go/doc.go (right): https://codereview.appspot.com/12566046/diff/1/src/cmd/go/doc.go#newcode251 src/cmd/go/doc.go:251: the tests for the specified packages. On 2013/08/13 04:40:49, r wrote: > also? or only? also
Sign in to reply to this message.
LGTM
Sign in to reply to this message.
*** Submitted as https://code.google.com/p/go/source/detail?r=9f6a7e4c3f62 *** cmd/go: add -t flag to 'go get' to download test dependencies Fixes issue 5126. R=golang-dev, dsymonds, bradfitz, r, rsc, rogpeppe CC=golang-dev https://codereview.appspot.com/12566046
Sign in to reply to this message.
|