You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael Haggerty <mh...@alum.mit.edu> on 2006/04/03 13:47:30 UTC
[PATCH] Allow multiple tests to be run from a Python test script
Hello,
I have been working on the cvs2svn project for many months, though I
haven't previously contributed to the subversion project. We at cvs2svn
also use the "svntest" framework for testing the conversion script (via
svn:externals). While working on that project, I came up with a few
ideas for improvements to svntest that I would like to submit.
The first one is in the attachment. It allows an arbitrary subset of
tests to be run in one invocation of a test script, using something like
$ ./test-script 3 7 9
For orthogonality it also allows the information about specified tests
to be printed out:
$ ./test-script list 3 7 9
Previously, the example above would have printed information about all
of the tests without executing any.
(I think it would be nice to change the "list" subcommand into a
"--list" option, but that change is not included here.)
Yours,
Michael
[[[
Allow multiple unit tests to be run at once.
Previously, a Python unit test script could run *all* of its tests, or
exactly *one* of them. This change allows an arbitrary selection of
tests to be run in one invocation of the test script.
For orthogonality, I also changed the "list" subcommand to list the
docstrings only for the tests that would otherwise have been executed.
(Thus, "test-script.py list" lists all tests, whereas "test-script.py
list 12 13" lists the information only for tests 12 and 13.)
* subversion/tests/cmdline/svntest/main.py (_internal_run_tests):
Change second argument from an optional integer to a required list of
integers. All tests whose numbers are in the list are executed.
(run_tests): Allow multiple test numbers to be specified on the
command line. Process the list subcommand only after all
command-line parameters have been parsed, and if any test numbers
were passed as arguments, then only list the information for those
tests. Update function comment.
* subversion/tests/cmdline/README: Updated documentation to describe
the new possibilities.
]]]
Re: [PATCH] Allow multiple tests to be run from a Python test script
Posted by Daniel Rall <dl...@collab.net>.
On Tue, 04 Apr 2006, Michael Haggerty wrote:
> Daniel Rall wrote:
> > On Mon, 03 Apr 2006, Michael Haggerty wrote:
> >>(I think it would be nice to change the "list" subcommand into a
> >>"--list" option, but that change is not included here.)
> >
> > +1, I'd like to see this as well.
> >
> > Michael, many thanks for the terrific description and flawless patch.
> > I've committed the patch to Subversion trunk in r19144.
>
> Thanks for the quick response.
>
> Here are patches for the "--list" option. The first attached patch adds
> the "--list" option:
>
> [[[
> Add a "--list" option (with the same meaning as the "list" subcommand).
>
> Add a --list option, and deprecates but does not remove the "list"
> subcommand.
>
> * subversion/tests/cmdline/svntest/main.py (run_tests): Added a --list
> option, with the same meaning as the old "list" subcommand.
>
> * subversion/tests/cmdline/README: Updated documentation to reflect
> change.
> ]]]
I've committed this change to Subversion trunk in r19178.
> The second (optional) attached patch removes the "list" subcommand. If
> you think that anybody relies on the "list" subcommand and doesn't want
> to switch to "--list", then you can skip this patch.
>
> [[[
> Remove the "list" subcommand (the new "--list" option covers its uses).
>
> * subversion/tests/cmdline/svntest/main.py (run_tests): Removed the
> "list" subcommand, as its functionality is available via the new
> "--list" option.
> ]]]
I'm in favor of committing the second patch as well to remove the old
behavior, but I'll let this sit for a bit to give others a chance to
respond.
--
Daniel Rall
Re: [PATCH] Allow multiple tests to be run from a Python test script
Posted by Michael Haggerty <mh...@alum.mit.edu>.
Daniel Rall wrote:
> On Mon, 03 Apr 2006, Michael Haggerty wrote:
>>(I think it would be nice to change the "list" subcommand into a
>>"--list" option, but that change is not included here.)
>
> +1, I'd like to see this as well.
>
> Michael, many thanks for the terrific description and flawless patch.
> I've committed the patch to Subversion trunk in r19144.
Thanks for the quick response.
Here are patches for the "--list" option. The first attached patch adds
the "--list" option:
[[[
Add a "--list" option (with the same meaning as the "list" subcommand).
Add a --list option, and deprecates but does not remove the "list"
subcommand.
* subversion/tests/cmdline/svntest/main.py (run_tests): Added a --list
option, with the same meaning as the old "list" subcommand.
* subversion/tests/cmdline/README: Updated documentation to reflect
change.
]]]
The second (optional) attached patch removes the "list" subcommand. If
you think that anybody relies on the "list" subcommand and doesn't want
to switch to "--list", then you can skip this patch.
[[[
Remove the "list" subcommand (the new "--list" option covers its uses).
* subversion/tests/cmdline/svntest/main.py (run_tests): Removed the
"list" subcommand, as its functionality is available via the new
"--list" option.
]]]
Michael
Re: [PATCH] Allow multiple tests to be run from a Python test script
Posted by Daniel Rall <dl...@collab.net>.
On Mon, 03 Apr 2006, Michael Haggerty wrote:
...
> We at cvs2svn also use the "svntest" framework for testing the
> conversion script (via svn:externals). While working on that
> project, I came up with a few ideas for improvements to svntest that
> I would like to submit.
>
> The first one is in the attachment. It allows an arbitrary subset of
> tests to be run in one invocation of a test script, using something like
>
> $ ./test-script 3 7 9
This is an excellent idea.
> For orthogonality it also allows the information about specified tests
> to be printed out:
>
> $ ./test-script list 3 7 9
This is reasonable, especially once the list command is turned into a
--list argument.
...
> (I think it would be nice to change the "list" subcommand into a
> "--list" option, but that change is not included here.)
+1, I'd like to see this as well.
Michael, many thanks for the terrific description and flawless patch.
I've committed the patch to Subversion trunk in r19144.
--
Daniel Rall