https://codereview.appspot.com/87130045/diff/40001/environs/sync/sync_test.go#newcode280
environs/sync/sync_test.go:280: os.Setenv("GOPATH", os.Getenv("GOPATH"))
On 2014/05/07 12:52:05, fwereade wrote:
> This is wrong. You need to capture the result of Getenv at setup time
-- sadly,
> you can't just drop the defer and move the code and actually have it
work the
> same ;).
> edit: I'm getting surer. I'll be around later tonight, let's chat live
-- it's
> been a while since I saw this code, and I might be missing something,
but I
> think there's something funky about the layering here.
UploadTools was being mocked in several places in the tests before my
cl. Each place reproduced the same functionality, so I created this
function clean things up.
As such, shouldn't removing UploadTools be done in a separate branch? If
so, for now shouldn't we leave this function as it at least cleans up
all the stray mock UploadTools funcs and eases making UploadTools
unmockable?
What are you referring to when you talk about build logic in
agent/tools?
https://codereview.appspot.com/87130045/diff/40001/environs/tools/testing/testing.go#newcode62
environs/tools/testing/testing.go:62: toolsDir =
filepath.Join(c.MkDir(), "jujud")
On 2014/05/07 12:52:06, fwereade wrote:
> This seems strange to me... AFAICS the only client passes in "", and
the
> replacement "jujud" directory is always empty anyway, so can't we
just: drop the
> dir param, skip the Archive call, write nothing, return the hash of
the empty
> file, and be done?
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ bootstrap/ bootstrap_ test.go bootstrap/ bootstrap_ test.go (right):
File environs/
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ bootstrap/ bootstrap_ test.go# newcode24 bootstrap/ bootstrap_ test.go: 24: ttesting net/juju- core/environs/ tools/testing"
environs/
"launchpad.
On 2014/05/07 12:52:05, fwereade wrote:
> explicit "toolstesting" throughout please
Done.
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ sync/sync_ test.go sync/sync_ test.go (right):
File environs/
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ sync/sync_ test.go# newcode275 sync/sync_ test.go: 275: os.Setenv("GOPATH", gopath)
environs/
On 2014/05/07 12:52:06, fwereade wrote:
> do we *have* to mess with the real environment? I accept that
*perhaps* we do,
> but, eww.
Done. Using s.PatchEnvPathP repend.
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ sync/sync_ test.go# newcode280 sync/sync_ test.go: 280: os.Setenv("GOPATH", os.Getenv( "GOPATH" ))
environs/
On 2014/05/07 12:52:05, fwereade wrote:
> This is wrong. You need to capture the result of Getenv at setup time
-- sadly,
> you can't just drop the defer and move the code and actually have it
work the
> same ;).
Done. I've mocked go cmd directly.
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ sync/sync_ test.go# newcode440 sync/sync_ test.go: 440: // c.Assert(version{}, gc.IsNil)
environs/
On 2014/05/07 12:52:06, fwereade wrote:
> c.Assert(vers, gc.DeepEquals, version.Binary{}) ?
Done.
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ tools/testing/ testing. go tools/testing/ testing. go (right):
File environs/
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ tools/testing/ testing. go#newcode37 tools/testing/ testing. go:37: // exposed and can itself be
environs/
neatly mocked?
On 2014/05/07 12:52:06, fwereade wrote:
> I feel like fixing *this* TODO might have been a step in a slightly
better
> direction, but I'm not totally sure at this point.
> edit: I'm getting surer. I'll be around later tonight, let's chat live
-- it's
> been a while since I saw this code, and I might be missing something,
but I
> think there's something funky about the layering here.
UploadTools was being mocked in several places in the tests before my
cl. Each place reproduced the same functionality, so I created this
function clean things up.
As such, shouldn't removing UploadTools be done in a separate branch? If
so, for now shouldn't we leave this function as it at least cleans up
all the stray mock UploadTools funcs and eases making UploadTools
unmockable?
What are you referring to when you talk about build logic in
agent/tools?
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ tools/testing/ testing. go#newcode62 tools/testing/ testing. go:62: toolsDir = Join(c. MkDir() , "jujud")
environs/
filepath.
On 2014/05/07 12:52:06, fwereade wrote:
> This seems strange to me... AFAICS the only client passes in "", and
the
> replacement "jujud" directory is always empty anyway, so can't we
just: drop the
> dir param, skip the Archive call, write nothing, return the hash of
the empty
> file, and be done?
Done.
https:/ /codereview. appspot. com/87130045/ diff/40001/ environs/ tools/testing/ testing. go#newcode76 tools/testing/ testing. go:76: // getMockBuildTools returns a TarballFunc implementation which generates
environs/
sync.BuildTools
On 2014/05/07 12:52:06, fwereade wrote:
> s/getM/GetM/
Done.
https:/ /codereview. appspot. com/87130045/