You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/03/21 18:18:25 UTC

svn commit: r1459410 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Author: julianfoad
Date: Thu Mar 21 17:18:24 2013
New Revision: 1459410

URL: http://svn.apache.org/r1459410
Log:
In several tests in merge_tests.py, change directory to the WC first, so the
paths printed during the test run are much shorter than they would otherwise
be, to ease debugging.

* subversion/tests/cmdline/merge_tests.py
  (...several tests...): As above.

Modified:
    subversion/trunk/subversion/tests/cmdline/merge_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1459410&r1=1459409&r2=1459410&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Thu Mar 21 17:18:24 2013
@@ -16781,6 +16781,8 @@ def merge_adds_subtree_with_mergeinfo(sb
   "merge adds subtree with mergeinfo"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
   wc_disk, wc_status = set_up_branch(sbox, False, 2)
 
@@ -16909,6 +16911,8 @@ def reverse_merge_adds_subtree(sbox):
   "reverse merge adds subtree"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
   wc_disk, wc_status = set_up_branch(sbox)
 
@@ -17044,6 +17048,8 @@ def merged_deletion_causes_tree_conflict
   "merged deletion causes spurious tree conflict"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
 
   A_path        = sbox.ospath('A')
@@ -17116,6 +17122,8 @@ def record_only_merge_adds_new_subtree_m
   "record only merge adds new subtree mergeinfo"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
   wc_disk, wc_status = set_up_branch(sbox)
 
@@ -17411,6 +17419,8 @@ def svnmucc_abuse_1(sbox):
   "svnmucc: merge a replacement"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
 
   ## Using A/ as our trunk, since one cannot replace the root.
@@ -17465,6 +17475,8 @@ def merge_source_with_replacement(sbox):
   "replacement in merge source not notified correctly"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
 
   # Some paths we'll care about.
@@ -17565,6 +17577,8 @@ def reverse_merge_with_rename(sbox):
   "reverse merge applies revs in reverse order"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
 
   # Some paths we'll care about.
@@ -17647,15 +17661,17 @@ def reverse_merge_with_rename(sbox):
 def merge_adds_then_deletes_subtree(sbox):
   "merge adds then deletes subtree"
 
+  sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+  wc_dir = sbox.wc_dir
+
   # Some paths we'll care about.
   A_path         = sbox.ospath('A')
   nu_path        = sbox.ospath('A/C/nu')
   C_branch_path  = sbox.ospath('branch/C')
   nu_branch_path = sbox.ospath('branch/C/nu')
 
-  sbox.build()
-  wc_dir = sbox.wc_dir
-
   # Make a branch.
   svntest.actions.run_and_verify_svn(None, None, [], 'copy',
                                      sbox.repo_url + '/A',
@@ -17717,6 +17733,11 @@ def merge_adds_then_deletes_subtree(sbox
 def merge_with_added_subtrees_with_mergeinfo(sbox):
   "merge with added subtrees with mergeinfo"
 
+  sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+  wc_dir = sbox.wc_dir
+
   # Some paths we'll care about.
   A_path      = sbox.ospath('A')
   Y_path      = sbox.ospath('A/C/X/Y')
@@ -17727,9 +17748,6 @@ def merge_with_added_subtrees_with_merge
   W_COPY_path = sbox.ospath('A_COPY/C/X/Y/Z/W')
   A_COPY2_path = sbox.ospath('A_COPY_2')
 
-  sbox.build()
-  wc_dir = sbox.wc_dir
-
   # Make two branches of ^/A and then make a few edits under A in r4-7:
   wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=2)
 
@@ -17889,6 +17907,11 @@ def merge_with_added_subtrees_with_merge
 def merge_with_externals_with_mergeinfo(sbox):
   "merge with externals with mergeinfo"
 
+  sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+  wc_dir = sbox.wc_dir
+
   # Some paths we'll care about.
   A_path = sbox.ospath('A')
   A_COPY_path = sbox.ospath('A_COPY')
@@ -17896,9 +17919,6 @@ def merge_with_externals_with_mergeinfo(
   mu_COPY_path = sbox.ospath('A_COPY/mu')
   mu_path = sbox.ospath('A/mu')
 
-  sbox.build()
-  wc_dir = sbox.wc_dir
-
   # Make a branch of ^/A and then make a few edits under A in r3-6:
   wc_disk, wc_status = set_up_branch(sbox)
 
@@ -18070,6 +18090,8 @@ def merge_target_selection(sbox):
   "merge target selection handling"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
 
   # r2
   sbox.simple_mkdir('dir')
@@ -18165,6 +18187,8 @@ def merge_properties_on_adds(sbox):
   "merged directory properties are added"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
 
   sbox.simple_copy('A/D/G', 'G')
 
@@ -18406,6 +18430,8 @@ def conflict_aborted_mergeinfo_described
   "conflicted split merge can be repeated"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
 
   trunk = 'A'
   branch = 'A2'
@@ -18596,6 +18622,8 @@ def multiple_editor_drive_merge_notifica
   "each editor drive gets its own notification"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
 
   iota_branch_path = sbox.ospath('iota-copy')
   C_branch_path = sbox.ospath('branch')
@@ -18684,6 +18712,8 @@ def multiple_editor_drive_merge_notifica
 def single_editor_drive_merge_notifications(sbox):
   "single editor drive merge notifications"
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
   wc_dir = sbox.wc_dir
 
   A_copy_path = sbox.ospath('A_COPY')
@@ -18777,6 +18807,8 @@ def conflicted_split_merge_with_resolve(
   "conflicted split merge with resolve"
 
   sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
 
   trunk = 'A'
   branch = 'A2'



Re: svn commit: r1459410 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Julian Foad <ju...@btopenworld.com>.
Bert Huijben wrote:

>>  URL: http://svn.apache.org/r1459410
>>  Log:
>>  In several tests in merge_tests.py, change directory to the WC first, so 
>> the  paths printed during the test run are much shorter than they would
>>  otherwise  be, to ease debugging.
> 
> Can we make this optional behavior of the testsuite (or maybe just sbox.build()) 
> somehow?

I would like to, but have tried before and it's actually very hard.  We store several key paths as relative paths in the test suite framework -- path to where all the tests' working copies should be created, path to where the read-only Greek repository is to be found, etc. -- without being clear what they're relative to.  Some of them are inter-related, and so the simple trick of changing directory to the WC dir and then setting sbox.wc_dir='' only works as long as we don't then try to use certain other functions such as cloning the WC or accessing the pristine Greek repo.  In other words, it's a hack.

> I really like this behavior while debugging, while in general always testing 
> with the current directory can introduce other kinds of problems, just like our 
> in almost every case the working copy root and repository root are the same 
> location during our tests.
> (For some time during 1.7 development the svnversion code only worked correctly 
> in this scenario and the test suite didn't notice)

Yup, that's a concern.

- Julian

RE: svn commit: r1459410 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: julianfoad@apache.org [mailto:julianfoad@apache.org]
> Sent: donderdag 21 maart 2013 10:18
> To: commits@subversion.apache.org
> Subject: svn commit: r1459410 -
> /subversion/trunk/subversion/tests/cmdline/merge_tests.py
> 
> Author: julianfoad
> Date: Thu Mar 21 17:18:24 2013
> New Revision: 1459410
> 
> URL: http://svn.apache.org/r1459410
> Log:
> In several tests in merge_tests.py, change directory to the WC first, so the
> paths printed during the test run are much shorter than they would
> otherwise
> be, to ease debugging.

Can we make this optional behavior of the testsuite (or maybe just sbox.build()) somehow?

I really like this behavior while debugging, while in general always testing with the current directory can introduce other kinds of problems, just like our in almost every case the working copy root and repository root are the same location during our tests.
(For some time during 1.7 development the svnversion code only worked correctly in this scenario and the test suite didn't notice)


	Bert
 



RE: svn commit: r1459410 - /subversion/trunk/subversion/tests/cmdline/merge_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: julianfoad@apache.org [mailto:julianfoad@apache.org]
> Sent: donderdag 21 maart 2013 10:18
> To: commits@subversion.apache.org
> Subject: svn commit: r1459410 -
> /subversion/trunk/subversion/tests/cmdline/merge_tests.py
> 
> Author: julianfoad
> Date: Thu Mar 21 17:18:24 2013
> New Revision: 1459410
> 
> URL: http://svn.apache.org/r1459410
> Log:
> In several tests in merge_tests.py, change directory to the WC first, so the
> paths printed during the test run are much shorter than they would
> otherwise
> be, to ease debugging.

Can we make this optional behavior of the testsuite (or maybe just sbox.build()) somehow?

I really like this behavior while debugging, while in general always testing with the current directory can introduce other kinds of problems, just like our in almost every case the working copy root and repository root are the same location during our tests.
(For some time during 1.7 development the svnversion code only worked correctly in this scenario and the test suite didn't notice)


	Bert