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

Re: [PATCH] input_validation_tests.py: Reduce overhead of multiple checkouts.

From: Noorul Islam K M <noorul_at_collab.net>
Date: Thu, 24 Feb 2011 13:52:14 +0530

Lieven Govaerts <svnlgo_at_mobsol.be> writes:

> 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?
>

Yes you are 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.
>

I will explore this and let you know.

Thanks and Regards
Noorul
Received on 2011-02-24 09:23:02 CET

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.