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

Re: svn commit: r27988 - in trunk: . subversion/tests/cmdline subversion/tests/cmdline/svndumpfilter_tests_data subversion/tests/cmdline/svntest

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-11-23 20:34:34 CET

What exactly does the test test, other than that "svnadmin load"
doesn't choke? Shouldn't you actually be testing that the mergeinfo
is correct somewhere?

Good start though.

--dave

On Nov 23, 2007 7:38 AM, <stylesen@tigris.org> wrote:
> Author: stylesen
> Date: Fri Nov 23 04:38:48 2007
> New Revision: 27988
>
> Log:
> Test suite for svndumpfilter tool - issue 3027.
>
> Add test for issue #2982.
>
> * build.conf
> (test-scripts): Add svndumpfilter_tests.py
>
> * subversion/tests/cmdline/svndumpfilter_tests.py
> (): New test suite for svndumpfilter tool along with test for issue #2982.
>
> * subversion/tests/cmdline/svntest/main.py
> (): Add svndumpfilter_binary location
>
> * subversion/tests/cmdline/svndumpfilter_tests_data/with_merges.dump
> (): Dump file for testing issue #2982
>
>
> Added:
> trunk/subversion/tests/cmdline/svndumpfilter_tests.py (contents, props changed)
> trunk/subversion/tests/cmdline/svndumpfilter_tests_data/
> trunk/subversion/tests/cmdline/svndumpfilter_tests_data/with_merges.dump
> Modified:
> trunk/build.conf
> trunk/subversion/tests/cmdline/svntest/main.py
>
> Modified: trunk/build.conf
> URL: http://svn.collab.net/viewvc/svn/trunk/build.conf?pathrev=27988&r1=27987&r2=27988
> ==============================================================================
> --- trunk/build.conf (original)
> +++ trunk/build.conf Fri Nov 23 04:38:48 2007
> @@ -95,6 +95,7 @@
> subversion/tests/cmdline/svnsync_tests.py
> subversion/tests/cmdline/authz_tests.py
> subversion/tests/cmdline/depth_tests.py
> + subversion/tests/cmdline/svndumpfilter_tests.py
>
> bdb-test-scripts =
>
>
> Added: trunk/subversion/tests/cmdline/svndumpfilter_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svndumpfilter_tests.py?pathrev=27988
> ==============================================================================
> --- (empty file)
> +++ trunk/subversion/tests/cmdline/svndumpfilter_tests.py Fri Nov 23 04:38:48 2007
> @@ -0,0 +1,122 @@
> +#!/usr/bin/env python
> +#
> +# svndumpfilter_tests.py: testing the 'svndumpfilter' tool.
> +#
> +# Subversion is a tool for revision control.
> +# See http://subversion.tigris.org for more information.
> +#
> +# ====================================================================
> +# Copyright (c) 2000-2007 CollabNet. All rights reserved.
> +#
> +# This software is licensed as described in the file COPYING, which
> +# you should have received as part of this distribution. The terms
> +# are also available at http://subversion.tigris.org/license-1.html.
> +# If newer versions of this license are posted there, you may use a
> +# newer version instead, at your option.
> +#
> +######################################################################
> +
> +# General modules
> +import os
> +import sys
> +
> +# Our testing module
> +import svntest
> +from svntest.verify import SVNExpectedStdout, SVNExpectedStderr
> +
> +# Get some helper routines from svnadmin_tests
> +from svnadmin_tests import load_and_verify_dumpstream, test_create
> +
> +# (abbreviation)
> +Skip = svntest.testcase.Skip
> +SkipUnless = svntest.testcase.SkipUnless
> +XFail = svntest.testcase.XFail
> +Item = svntest.wc.StateItem
> +
> +
> +######################################################################
> +# Helper routines
> +
> +
> +def filter_and_return_output(dump, *varargs):
> + """Filter the array of lines passed in 'dump' and return the output"""
> +
> + if type(dump) is type(""):
> + dump = [ dump ]
> +
> + ## TODO: Should we need to handle errput?
> + output, errput = \
> + svntest.main.run_command_stdin(
> + svntest.main.svndumpfilter_binary, None, 1, dump, *varargs)
> +
> + return output
> +
> +
> +######################################################################
> +# Tests
> +
> +
> +def reflect_dropped_renumbered_revs(sbox):
> + "reflect dropped renumbered revs in svn:mergeinfo"
> +
> + ## See http://subversion.tigris.org/issues/show_bug.cgi?id=2982. ##
> +
> + # Test svndumpfilter with include option
> + test_create(sbox)
> + dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
> + 'svndumpfilter_tests_data',
> + 'with_merges.dump')
> + dumpfile = svntest.main.file_read(dumpfile_location)
> +
> + filtered_out = filter_and_return_output(dumpfile, "include",
> + "trunk", "branch1",
> + "--skip-missing-merge-sources",
> + "--drop-empty-revs",
> + "--renumber-revs", "--quiet")
> + load_and_verify_dumpstream(sbox,[],[], None, filtered_out)
> +
> + # Verify the svn:mergeinfo properties
> + svntest.actions.run_and_verify_svn(None,
> + [sbox.repo_url+"/trunk - /branch1:4-5\n"],
> + [], 'propget', 'svn:mergeinfo', '-R',
> + sbox.repo_url + '/trunk')
> + svntest.actions.run_and_verify_svn(None,
> + [sbox.repo_url+"/branch1 - /trunk:1-2\n"],
> + [], 'propget', 'svn:mergeinfo', '-R',
> + sbox.repo_url + '/branch1')
> +
> + # Test svndumpfilter with exclude option
> + test_create(sbox)
> + filtered_out = filter_and_return_output(dumpfile, "exclude",
> + "branch1",
> + "--skip-missing-merge-sources",
> + "--drop-empty-revs",
> + "--renumber-revs", "--quiet")
> + load_and_verify_dumpstream(sbox,[],[], None, filtered_out)
> +
> + # Verify the svn:mergeinfo properties
> + svntest.actions.run_and_verify_svn(None,
> + [sbox.repo_url+"/trunk - \n"],
> + [], 'propget', 'svn:mergeinfo', '-R',
> + sbox.repo_url + '/trunk')
> + svntest.actions.run_and_verify_svn(None,
> + [sbox.repo_url+"/branch2 - /trunk:1-2\n"],
> + [], 'propget', 'svn:mergeinfo', '-R',
> + sbox.repo_url + '/branch2')
> +
> +
> +########################################################################
> +# Run the tests
> +
> +
> +# list all tests here, starting with None:
> +test_list = [ None,
> + reflect_dropped_renumbered_revs,
> + ]
> +
> +if __name__ == '__main__':
> + svntest.main.run_tests(test_list)
> + # NOTREACHED
> +
> +
> +### End of file.
>
> Added: trunk/subversion/tests/cmdline/svndumpfilter_tests_data/with_merges.dump
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svndumpfilter_tests_data/with_merges.dump?pathrev=27988
> ==============================================================================
> --- (empty file)
> +++ trunk/subversion/tests/cmdline/svndumpfilter_tests_data/with_merges.dump Fri Nov 23 04:38:48 2007
> @@ -0,0 +1,354 @@
> +SVN-fs-dump-format-version: 2
> +
> +UUID: a1b7b7ba-941c-4386-9e40-393dd6d760dd
> +
> +Revision-number: 0
> +Prop-content-length: 56
> +Content-length: 56
> +
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:52.981952Z
> +PROPS-END
> +
> +Revision-number: 1
> +Prop-content-length: 117
> +Content-length: 117
> +
> +K 7
> +svn:log
> +V 14
> +Creating trunk
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:53.035734Z
> +PROPS-END
> +
> +Node-path: trunk
> +Node-kind: dir
> +Node-action: add
> +Prop-content-length: 10
> +Content-length: 10
> +
> +PROPS-END
> +
> +
> +Revision-number: 2
> +Prop-content-length: 119
> +Content-length: 119
> +
> +K 7
> +svn:log
> +V 16
> +commit all files
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:54.168549Z
> +PROPS-END
> +
> +Node-path: trunk/1
> +Node-kind: file
> +Node-action: add
> +Prop-content-length: 10
> +Text-content-length: 15
> +Text-content-md5: 88c16a56754e0f17a93d269ae74dde9b
> +Content-length: 25
> +
> +PROPS-END
> +This is file 1
> +
> +
> +Node-path: trunk/2
> +Node-kind: file
> +Node-action: add
> +Prop-content-length: 10
> +Text-content-length: 15
> +Text-content-md5: db06069ef1c9f40986ffa06db4fe8fd7
> +Content-length: 25
> +
> +PROPS-END
> +This is file 2
> +
> +
> +Node-path: trunk/3
> +Node-kind: file
> +Node-action: add
> +Prop-content-length: 10
> +Text-content-length: 15
> +Text-content-md5: 95227e10e2c33771e1c1379b17330c86
> +Content-length: 25
> +
> +PROPS-END
> +This is file 3
> +
> +
> +Node-path: trunk/4
> +Node-kind: file
> +Node-action: add
> +Prop-content-length: 10
> +Text-content-length: 15
> +Text-content-md5: 601120837709ea5ee34dadddf5289113
> +Content-length: 25
> +
> +PROPS-END
> +This is file 4
> +
> +
> +Node-path: trunk/5
> +Node-kind: file
> +Node-action: add
> +Prop-content-length: 10
> +Text-content-length: 15
> +Text-content-md5: 657c74cf3521f7760f9203ac7d9d2cdb
> +Content-length: 25
> +
> +PROPS-END
> +This is file 5
> +
> +
> +Revision-number: 3
> +Prop-content-length: 118
> +Content-length: 118
> +
> +K 7
> +svn:log
> +V 15
> +Creating branch
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:55.138144Z
> +PROPS-END
> +
> +Node-path: branch1
> +Node-kind: dir
> +Node-action: add
> +Node-copyfrom-rev: 2
> +Node-copyfrom-path: trunk
> +Prop-content-length: 45
> +Content-length: 45
> +
> +K 13
> +svn:mergeinfo
> +V 10
> +/trunk:1-2
> +PROPS-END
> +
> +
> +Revision-number: 4
> +Prop-content-length: 118
> +Content-length: 118
> +
> +K 7
> +svn:log
> +V 15
> +Creating branch
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:55.174720Z
> +PROPS-END
> +
> +Node-path: branch2
> +Node-kind: dir
> +Node-action: add
> +Node-copyfrom-rev: 3
> +Node-copyfrom-path: trunk
> +Prop-content-length: 45
> +Content-length: 45
> +
> +K 13
> +svn:mergeinfo
> +V 10
> +/trunk:1-3
> +PROPS-END
> +
> +
> +Revision-number: 5
> +Prop-content-length: 116
> +Content-length: 116
> +
> +K 7
> +svn:log
> +V 13
> +commit change
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:56.137189Z
> +PROPS-END
> +
> +Node-path: branch1/1
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: 4769ac569ba7b962d2d2bf95c90f80b4
> +Content-length: 39
> +
> +This is file 1
> +This is file 1 modified
> +
> +
> +Revision-number: 6
> +Prop-content-length: 116
> +Content-length: 116
> +
> +K 7
> +svn:log
> +V 13
> +commit change
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:57.144314Z
> +PROPS-END
> +
> +Node-path: branch1/2
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: e4f2deb441ef67de82f3aefc6aef255e
> +Content-length: 39
> +
> +This is file 2
> +This is file 2 modified
> +
> +
> +Revision-number: 7
> +Prop-content-length: 116
> +Content-length: 116
> +
> +K 7
> +svn:log
> +V 13
> +commit change
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:58.146184Z
> +PROPS-END
> +
> +Node-path: branch2/1
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: 4769ac569ba7b962d2d2bf95c90f80b4
> +Content-length: 39
> +
> +This is file 1
> +This is file 1 modified
> +
> +
> +Revision-number: 8
> +Prop-content-length: 116
> +Content-length: 116
> +
> +K 7
> +svn:log
> +V 13
> +commit change
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:36:59.148564Z
> +PROPS-END
> +
> +Node-path: branch2/2
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: e4f2deb441ef67de82f3aefc6aef255e
> +Content-length: 39
> +
> +This is file 2
> +This is file 2 modified
> +
> +
> +Revision-number: 9
> +Prop-content-length: 116
> +Content-length: 116
> +
> +K 7
> +svn:log
> +V 13
> +commit change
> +K 10
> +svn:author
> +V 8
> +stylesen
> +K 8
> +svn:date
> +V 27
> +2007-11-22T07:37:02.140253Z
> +PROPS-END
> +
> +Node-path: trunk
> +Node-kind: dir
> +Node-action: change
> +Prop-content-length: 47
> +Content-length: 47
> +
> +K 13
> +svn:mergeinfo
> +V 12
> +/branch1:4-8
> +PROPS-END
> +
> +
> +Node-path: trunk/1
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: 4769ac569ba7b962d2d2bf95c90f80b4
> +Content-length: 39
> +
> +This is file 1
> +This is file 1 modified
> +
> +
> +Node-path: trunk/2
> +Node-kind: file
> +Node-action: change
> +Text-content-length: 39
> +Text-content-md5: e4f2deb441ef67de82f3aefc6aef255e
> +Content-length: 39
> +
> +This is file 2
> +This is file 2 modified
> +
> +
>
> Modified: trunk/subversion/tests/cmdline/svntest/main.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svntest/main.py?pathrev=27988&r1=27987&r2=27988
> ==============================================================================
> --- trunk/subversion/tests/cmdline/svntest/main.py (original)
> +++ trunk/subversion/tests/cmdline/svntest/main.py Fri Nov 23 04:38:48 2007
> @@ -130,6 +130,8 @@
> svnlook_binary = os.path.abspath('../../svnlook/svnlook' + _exe)
> svnsync_binary = os.path.abspath('../../svnsync/svnsync' + _exe)
> svnversion_binary = os.path.abspath('../../svnversion/svnversion' + _exe)
> +svndumpfilter_binary = os.path.abspath('../../svndumpfilter/svndumpfilter' + \
> + _exe)
>
> # Global variable indicating if we want verbose output, that is,
> # details of what commands each test does as it does them. This is
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

-- 
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 23 20:34:58 2007

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.