Symlinks in juju-core

William Reade william.reade at canonical.com
Tue Feb 5 23:30:33 UTC 2013


On Tue, 2013-02-05 at 17:03 +0400, John Arbash Meinel wrote:
> One of the bits that we might be looking at on our squad is getting
> juju-core working on Windows. The very first issue is that juju-core
> itself has symlinks in the source tree. (oneiric,precise,quantal point
> to 'series' in the testing/repo directory.)
> 
> I'm thinking this is only used by the test suite because it wants
> charm-information in a specific layout, but we don't want to have to
> reproduce it for difference series.

That is so.

> Would it be reasonable to change the test suite so that when it wants
> 'quantal/*' it just copies the content of 'series/*'. (In a TMP dir
> for the test suite, or maybe just ignored in the source tree? I prefer
> TMP).

Sorry to say, you'll have to check the tests, and the answer may not be
obvious by inspection. I'd generally be -1 on wanton speculative copies
of data; but then, I doubt there are very many test cases that made much
use of the symlinks. Your best route is probably to delete them one by
one and see what fails.

> Is that reasonable? The alternative is to have it try to symlink if it
> can, and then fall back to directory copies. Which would let you use
> symlinks if the platform supports it.

In general I prefer that the tests not make direct use of the sample
charms in the source tree: there are methods on those things that
actually write to the dir, and letting one of those hit the source tree
is a quick route to a string of confusing and apparently unrelated test
failures elsewhere.

That is, we're probably copying everything that matters anyway, and what
we're not copying we probably should be; so, I wouldn't expect the
difference made by a few extra copies in a few extra cases to be
significant, and I think I would willingly pay a small performance cost
in exchange for simple cross-platform tests.

Cheers
William




More information about the Juju-dev mailing list