On Mon, Feb 21, 2011 at 11:32 AM, Noorul Islam K M <noorul_at_collab.net>wrote:
> Noorul Islam K M <noorul_at_collab.net> writes:
>
> > Stefan Sperling <stsp_at_elego.ed> writes:
> >
> >> On Mon, Feb 21, 2011 at 01:44:35PM +0530, Noorul Islam K M wrote:
> >>
> >>>
> >>> This patch reduces checkout by around 23 times.
> >>
> >> On my system the difference is 43 seconds vs. 30 seconds.
> >>
> >> We lose the ability to easily spot which of the subtest is failing
> >> if we do this. I.e. instead of:
> >>
> >> ...
> >> PASS: input_validation_tests.py 19: non-working copy paths for 'status'
> >> FAIL: input_validation_tests.py 20: non-working copy paths for 'patch'
> >> PASS: input_validation_tests.py 21: non-working copy paths for 'switch'
> >> ...
> >>
> >> all we'd get is:
> >>
> >> FAIL: input_validation_tests.py 1: inavlid wc and url targets
> >>
> >> Is there a way of keeping these as individual tests but also
> >> avoiding the overhead of creating a repository and a working copy?
> >> If there isn't I would prefer to just leave this as it is now because
> >> I prefer the current output.
> >
> > I think it will be possible by keeping sandbox global. I will modify and
> > send an updated patch.
> >
>
> I looked into it. I don't think it is straight forward. I will leave it
> as such. As you said 13 seconds gain is no big deal.
>
So the tests need one read-only working copy for the whole suite, instead of
one per test right?
What about this:
- add optional setup_suite_func and destroy_suite_func parameters to
svntest.main.run_tests.
- in run_tests, before running the tests, call setup_suite_func. After
running the tests, call destroy_suite_func.
-> this is a standard feature of any unit test framework.
- in your setup_suite_func callback, checkout a working copy
- in your destroy_suite_func callback, rmtree the working copy
- in all tests, when creating the sandbox, pass the create_wc = false
option.
- in run_and_verify_svn_in_wc, use the new single working copy.
This doesn't guarantee the working copy stays unmodified, but since the
actual actions on the wc are centralized in one function
(run_and_verify_svn_in_wc) it's easy to see this from the code. You could
run "svn status" at the end of each test if you really want to be sure.
regards,
L
Received on 2011-02-24 08:11:50 CET