FYI, a few new testing functions and a package
Ian Booth
ian.booth at canonical.com
Fri Aug 2 04:17:25 UTC 2013
>
> testing.PatchEnvironment
>
> This method sets the environment variable with the specified value, and
> returns a function that will set it back to what it was. Simply used in
> a test like this:
>
> defer coretesting.PatchEnvironment(osenv.JujuLxcBridge, "br0")()
>
>
We have something similar in Goose. Which made me wonder what our policy is with
respect to collecting these sorts of useful utilities and packaging them so that
they are usable for more than just project X or Y individually. Even within
juju-core there's duplicated utility code to make up for Go's lack of this or
that feature. Usable errors is another example of Goose and juju-core solving
the same problem twice. There would be more as well I'm sure.
Is it worth trying to do something to package this common functionality? Or will
it be too hard due to Go's lack of dependency versioning? I really am adverse to
all the DRY violations / duplication in our collective code base.
More information about the Juju-dev
mailing list