[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] dump regression tests

From: <cmpilato_at_collab.net>
Date: 2002-07-15 13:25:44 CEST

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 <slamb@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
Received on Tue Jul 16 01:27:53 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.