Re: 3.0.20 regression testing

Lee <[email protected]>
Newsgroups gmane.comp.web.privoxy.devel
Message-ID <CAD8GWssgee6-a7d-yuMhi_NKQYETYRyfdm4909eEhSZdkY7kvw@mail.gmail.com>
On 1/4/13, Fabian Keil <[email protected]> wrote:
> Lee <[email protected]> wrote:
>
>> On 1/3/13, Fabian Keil <[email protected]> wrote:
>> >
>> > Using only the official files:
>> >
>> > actionsfile match-all.action
>> > actionsfile default.action
>> > actionsfile regression-tests.action
>> >
>> > I get:
>> >
>> > fk@r500 ~/git/privoxy $privoxy-regression-test.pl --max-level 109
>> > --show-skipped-tests
>> > 2013-01-03 20:26:44: Asking Privoxy for the number of action files
>> > available
> [...]
>> > 2013-01-03 20:26:57: Executed 658 regression tests. Skipped 7. 658
>> > successes, 0 failures.
>>
>> 13 seconds!!!  I wish.  Cygwin is *slow*
>
> On FreeBSD Privoxy-Regression-Test spends most of the time
> (IIRC more than 99%) executing curl, so you could try using
> a native curl binary which might make a difference.

I suspect a native curl binary would be more trouble than it's worth
since I'd also need a native perl binary + native whatever else the
regression test uses
.  The cygwin maintainers seem to place a much higher priority on
posix compatibility than playing nice with windows.  In other words, I
usually have problems when trying to mix cygwin & windows programs.

> You could also try profiling Privoxy-Regression-Test yourself first,
> but getting Devel::NYTProf running on Windows might not be your idea
> of a having a good time.

I think the problem is process creation in cygwin.  Try this on your FreeBSD box

$ cat speed.sh
#!/bin/sh
T=`date +"%S"`
N=0
while [ 1 ]; do
  if [ "$T" != "`date +"%S"`" ]; then
    printf "Loops: %s, time=%s\n" $N $T
    T=`date +"%S"`
    N=0
  fi
  N=`expr $N + 1`
done

$ ./speed.sh
Loops: 3, time=51
Loops: 23, time=52
Loops: 23, time=53
Loops: 22, time=54
Loops: 23, time=55
Loops: 23, time=56
Loops: 22, time=57
Loops: 23, time=58
Loops: 23, time=59
Loops: 22, time=00
Loops: 23, time=01
Loops: 22, time=02


>> > I usually silence them by setting the ignore flag,
>>
>> hrmm... maybe more documentation would help :)
>
> Now that I know that there is demand I should probably implement
> a proper solution. Of course this doesn't rule out explicitly
> documenting the work around as well ...
>
>> I took a quick look, but didn't see anything for an ignore flag.  Is
>> all your documentation inside of privoxy-regression-test.pl or is
>> there somewhere else I should be looking?
>
> Currently "the code is the documentation":

*sigh* I kinda thought so, my perl abilities leave much to be desired :(


> fk@r500 ~/git/privoxy $cat -n tools/privoxy-regression-test.pl
> [...]
>    578              } elsif ($token eq 'ignore' && $value =~ /Yes/i) {
>    579
>    580                  l(LL_FILE_LOADING, "Ignoring section: " .
> test_content_as_string($regression_tests[$si][$ri]));
>    581                  $regression_tests[$si][$ri]{'ignore'} = 1;
>    582                  $ignored++;
>    583
>    584              } elsif ($token eq 'expect status code') {
>
> Thus you can put "# Ignore = Yes" below any test you want to skip.

neat!  I'll give it a try

Thanks,
Lee

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.