Revisit Newbie Bazaar Repository and Branch Setup
vila
v.ladeuil+lp at free.fr
Fri Dec 10 09:00:32 GMT 2010
>>>>> Eric Siegerman <lists08-bzr at davor.org> writes:
<snip/>
> I tried to do this as a pair of shell-like tests.
Wow, well done !
> The one that uses simple pathnames was easy, but I couldn't figure
> out how to get $TESTDIR into the bzr+ssh: URLs for the other one.
> Is there a way to do that, or to avoid the necessity for it?
Tricky... Basically the shell-like tests are supposed to execute in a
directory and from there relative paths are available, but it never
occurred to me that you may need the directory itself...
So, no, there is no way to get your hands on this path which guarantee
test isolation (which is good) but makes it impossible to invoke servers
(which is... not so good, but may also be a can of worms).
Populating TEST_DIR as an available environment variable (which is
self.test_dir in the python tests) may be an elegant solution (and kudos
for your very precise diagnosis showing itself in the variable name ;).
Pedantically you really want HOME and WORK though which are
TEST_DIR/home and TEST_DIR/work since these are the directories that the
python tests really use. HOME is the home directory that can contain
~/.bazaar and WORK is the current directory where the script execution
starts.
This is pretty trivial.
But then we need to implement the variable interpolation and their
definition, which is less trivial but still doable.
As a first step we can settle with only the variable interpolation
considering that the scripts cannot change them (so we can just
interpolate them when parsing the script).
This may be good enough.
But do we really need to make the test scripts this powerful ?
I think you already did the most difficult part here: describing a
reproducing failure. From there writing a *python* test is easy enough.
So many thanks for that !
The next step is to file a bug :D
Vincent
P.S.: Also while *currently* the tests requires using files on disk, the
long term plan is to make them use files in memory. Making test servers
use the same in-memory file system is also needed, but making the client
and the server transparently share this file system may be a bit
harder. So overall, adding server access to the tests is... significant
work.
P.P.S.: And having to explain all these technical details to shell-like
script writers seems... bad. If the shell-like tests requires as much
knowledge as the python ones, they lose their simplicity focus, in my
humble-but-a-bit-disappointed opinion ;)
--02C451804E3.1291971634/axe--
More information about the bazaar
mailing list