[ditrack commit] r2068 - src/trunk/tests/api/update.tc
Ivan Glushkov
gli.work at gmail.com
Sat Sep 15 01:33:56 PDT 2007
On Fri, 14 Sep 2007 22:24:17 +0400, Vlad Skvortsov <vss at 73rus.com> wrote:
> gli at ditrack.org wrote:
>> Author: gli
>> Date: 2007-09-11 14:11:35 -0700 (Tue, 11 Sep 2007)
>> New Revision: 2068
>>
>> Modified:
>> src/trunk/tests/api/update.tc/test.py
>> Log:
>> removing just .svn/entries make my subversion return error while
>> updating: "svn: Can not open file work/db/.svn/entries: No such file or
>> directory". The simpliest way to pass test - to rename .svn
>>
>
> ...and "my subversion" is which subversion exactly?
>
> The point of the test is to check how we behave against a subversion
> failure. Could you please tell:
> 1) why does the test (before r2068) fail for you (how exactly?);
> 2) how does this change fixes the failure?
Hmm.
Lets review the test as i did when it began to fail.
1. create testcase
2. remove .svn/entries
3. try to update:
4. pass only if
e.message == "Database update failed: Can't parse the output"
and
e.details[0].startswith("Skipped '")
see the DITrack/SVN.py:
cmd = "%s update %s" % (self.svn_path, wc_path)
p = os.popen(cmd)
output = p.readlines()
# The close method returns the exit status of the process. See
# `pydoc os.popen`.
status = p.close()
if status:
raise Error(cmd, "'svn update' didn't succeed",
["Exit status: %d" % status]
)
try:
us = UpdateStatus(output)
except ValueError:
raise Error(cmd, "Can't parse the output",
map(lambda x: x.rstrip(), output)
)
i.e. we return "Database update failed: Can't parse the output" (and pass
the test) only if we returned 0 while updating subversion but couldn't
parse the output.
"My subversion" (version 1.3.2 (r19776)) with removed .svn/entries doesn't
return 0 while updating:
$ rm -f work/db/.svn/entries
$ svn up work/db
svn: Can't open file 'work/db/.svn/entries': Нет такого файла или каталога
$ echo $?
1
So in this case it returns different message in DITrack.Client.Error
("Database update failed: 'svn update' didn't succeed") and fails the test.
Then i check this test on svn-1.4.2. With removed .svn/entries it behave
such way:
$ rm -f work/db/.svn/entries
$ svn up work/db
Skipped 'work/db'
$ echo $?
0
The simplest way always to repeat originally designed behaviour with
svn-1.3.2 - is to remove .svn completely (or rename it). As i did.
I think this test checks only part of functionality, namely the situation
when we can't parse output from ditrack. And it doesn't test failure of
command 'svn update'.
Ivan.
More information about the Dev
mailing list