You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by cm...@collab.net on 2002/07/15 11:25:44 UTC

Re: [PATCH] dump regression tests

I'm all for having some dumper/loader tests, and I'm cool with these
as an initial go at it.  I have some ideas about how to do a real
suite of tests, but for now I'd be pleased if you could re-submit your
patch with a log message (see the HACKING file).

Branko, any reason why these wouldn't be Windows-safe?


Scott Lamb <sl...@slamb.org> writes:

> --/9DWx/yDrRhgMJTb
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> 
> Attached is a patch that does very simple regression tests for "svnadmin
> dump" issues #776 and #794. I checked, they both fail at the revision
> before they were reported fixed and pass afterward.
> 
> They just check if the revisions are dumped and no errors are printed.
> It would be nice to have something that actually checks if the dump
> output is correct. (And maybe catch the problem I'm having now, for
> example.)
> 
> --
> Scott Lamb
> 
> --/9DWx/yDrRhgMJTb
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="dump-regression-tests.patch"
> 
> Index: ./svnadmin_tests.py
> ===================================================================
> --- ./svnadmin_tests.py
> +++ ./svnadmin_tests.py	Mon Jul 15 17:03:27 2002
> @@ -55,6 +55,10 @@
>  #
>  #   'svnadmin lsrevs':   Parse headers as above.
>  #
> +#   'svnadmin dump':     A couple regression tests that ensure dump doesn't
> +#                        error out. The actual contents of the dump aren't
> +#                        verified at all.
> +#
>  #  ### TODO:  someday maybe we could parse the contents of trees too.
>  #
>  ######################################################################
> @@ -285,6 +289,50 @@
>  
>    return 0
>  
> +#----------------------------------------------------------------------
> +
> +def dump_copied_dir(sbox):
> +  "Tests dumping a copied directory (issue 776)."
> +  if sbox.build(): return 1
> +  wc_dir = sbox.wc_dir
> +  repo_dir = sbox.repo_dir
> +
> +  old_C_path = os.path.join(wc_dir, 'A', 'C')
> +  new_C_path = os.path.join(wc_dir, 'A', 'B', 'C')
> +  svntest.main.run_svn(None, 'cp', old_C_path, new_C_path)
> +  svntest.main.run_svn(None, 'ci', wc_dir, '--quiet', '-m', 'log msg')
> +
> +  output_lines, errput_lines = svntest.main.run_svnadmin("dump", repo_dir)
> +
> +  if errput_lines != ["* Dumped revision 0.\n",
> +                      "* Dumped revision 1.\n",
> +                      "* Dumped revision 2.\n"]:
> +    print errput_lines
> +    return 1
> +  return 0
> +
> +#----------------------------------------------------------------------
> +
> +def dump_move_dir_modify_child(sbox):
> +  "Tests dumping after copying a directory and modifying a child (issue 794)."
> +  if sbox.build(): return 1
> +  wc_dir = sbox.wc_dir
> +  repo_dir = sbox.repo_dir
> +
> +  B_path = os.path.join(wc_dir, 'A', 'B')
> +  b_path = os.path.join(wc_dir, 'A', 'b')
> +  svntest.main.run_svn(None, 'cp', B_path, b_path)
> +  svntest.main.file_append(os.path.join(b_path, 'lambda'), 'hello')
> +  svntest.main.run_svn(None, 'ci', wc_dir, '--quiet', '-m', 'log msg')
> +
> +  output_lines, errput_lines = svntest.main.run_svnadmin("dump", repo_dir)
> +
> +  if errput_lines != ["* Dumped revision 0.\n",
> +                      "* Dumped revision 1.\n",
> +                      "* Dumped revision 2.\n"]:
> +    print errput_lines
> +    return 1
> +  return 0
>  
>  
>  ########################################################################
> @@ -297,7 +345,9 @@
>                test_youngest,
>                create_txn,
>                remove_txn,
> -              list_revs
> +              list_revs,
> +              dump_copied_dir,
> +              dump_move_dir_modify_child
>               ]
>  
>  if __name__ == '__main__':
> 
> 
> --/9DWx/yDrRhgMJTb
> Content-Type: text/plain; charset=us-ascii
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> --/9DWx/yDrRhgMJTb--

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dump regression tests

Posted by Branko Čibej <br...@xbc.nu>.
cmpilato@collab.net wrote:

>Branko, any reason why these wouldn't be Windows-safe?
>  
>

Can't see anything wrong with them.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] dump regression tests w/ changelog

Posted by cm...@collab.net.
Scott Lamb <sl...@slamb.org> writes:

> Simple regression tests for "svnadmin dump" issues #776 and #794.
> These do *not* actually verify the dump is correct, merely that it
> completes without error.
> 
> * subversion/tests/clients/cmdline/svnadmin.py:
>   (dump_copied_dir): tests issue #776
>   (dump_move_dir_modify_child): tests issue #794

Thanks.  Committed (with mods) as revision 2531.  All I did was modify
the strings that describe the test functions so that they looked like
others in the test suite/file.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] dump regression tests w/ changelog

Posted by Scott Lamb <sl...@slamb.org>.
Simple regression tests for "svnadmin dump" issues #776 and #794.
These do *not* actually verify the dump is correct, merely that it
completes without error.

* subversion/tests/clients/cmdline/svnadmin.py:
  (dump_copied_dir): tests issue #776
  (dump_move_dir_modify_child): tests issue #794


Index: ./subversion/tests/clients/cmdline/svnadmin_tests.py
===================================================================
--- ./subversion/tests/clients/cmdline/svnadmin_tests.py
+++ ./subversion/tests/clients/cmdline/svnadmin_tests.py	Mon Jul 15 17:03:27 2002
@@ -55,6 +55,10 @@
 #
 #   'svnadmin lsrevs':   Parse headers as above.
 #
+#   'svnadmin dump':     A couple regression tests that ensure dump doesn't
+#                        error out. The actual contents of the dump aren't
+#                        verified at all.
+#
 #  ### TODO:  someday maybe we could parse the contents of trees too.
 #
 ######################################################################
@@ -285,6 +289,50 @@
 
   return 0
 
+#----------------------------------------------------------------------
+
+def dump_copied_dir(sbox):
+  "Tests dumping a copied directory (issue 776)."
+  if sbox.build(): return 1
+  wc_dir = sbox.wc_dir
+  repo_dir = sbox.repo_dir
+
+  old_C_path = os.path.join(wc_dir, 'A', 'C')
+  new_C_path = os.path.join(wc_dir, 'A', 'B', 'C')
+  svntest.main.run_svn(None, 'cp', old_C_path, new_C_path)
+  svntest.main.run_svn(None, 'ci', wc_dir, '--quiet', '-m', 'log msg')
+
+  output_lines, errput_lines = svntest.main.run_svnadmin("dump", repo_dir)
+
+  if errput_lines != ["* Dumped revision 0.\n",
+                      "* Dumped revision 1.\n",
+                      "* Dumped revision 2.\n"]:
+    print errput_lines
+    return 1
+  return 0
+
+#----------------------------------------------------------------------
+
+def dump_move_dir_modify_child(sbox):
+  "Tests dumping after copying a directory and modifying a child (issue 794)."
+  if sbox.build(): return 1
+  wc_dir = sbox.wc_dir
+  repo_dir = sbox.repo_dir
+
+  B_path = os.path.join(wc_dir, 'A', 'B')
+  b_path = os.path.join(wc_dir, 'A', 'b')
+  svntest.main.run_svn(None, 'cp', B_path, b_path)
+  svntest.main.file_append(os.path.join(b_path, 'lambda'), 'hello')
+  svntest.main.run_svn(None, 'ci', wc_dir, '--quiet', '-m', 'log msg')
+
+  output_lines, errput_lines = svntest.main.run_svnadmin("dump", repo_dir)
+
+  if errput_lines != ["* Dumped revision 0.\n",
+                      "* Dumped revision 1.\n",
+                      "* Dumped revision 2.\n"]:
+    print errput_lines
+    return 1
+  return 0
 
 
 ########################################################################
@@ -297,7 +345,9 @@
               test_youngest,
               create_txn,
               remove_txn,
-              list_revs
+              list_revs,
+              dump_copied_dir,
+              dump_move_dir_modify_child
              ]
 
 if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org