[wp-hackers] Who on the commit team or contributors actually run the Automattic WordPress Tests?

Jacob Santos wordpress at santosj.name
Wed Apr 2 03:13:52 GMT 2008

That is fascinating! I had that exact some problem and it about drove me 
crazy with my damn host. I was sure that it had to of been something in 
the Automattic WordPress Tests, but it doesn't.

Surprisingly, the problem fixed itself, so my host gets the chance to 
live. I don't know, try setting the max limit to 200 and see what 
happens. Probably has nothing.

To be honest, I really think my host was killing processes which were 
active for longer than a minute, because I finally was able to get PHP 
to install and still had the problem. Now, if you install PHP yourself 
and can change the PHP.ini, then it should be assumed that the values in 
php.ini would work (and they did, except that one area.

I'll go for violence myself and willing to hold a torch for you, but I'm 
actually just kidding. However, before you go crazy, well, I don't konw, 
they were never able to tell me what the issue was, but it works now.

It would probably be better if Alex would look for $argc and $argv and 
use those instead in the CLI environment.

DD32 wrote:
> For reference, Heres a slight change i made to allow me to run it 
> under windows and still access the cli args. only works for short 
> args, and ignores optional args(Which isnt a problem for the 
> wp-test.php file anyway)
> Added this to the start of wp-test.php:
> set_time_limit(0);
> var_dump( ini_get('max_execution_time') );
> if( ! function_exists('getopt') ){
>     function getopt($short=''){
>         $opts = array();
>         $params = explode(':', $short);
>         for($i=1; $i < count($_SERVER['argv']); $i++){
>             if( in_array(ltrim($_SERVER['argv'][$i], '-'), $params) ){
>                 if( isset($_SERVER['argv'][$i+1]) && 
> $_SERVER['argv'][$i+1]{0} != '-' ){
>                     $opts[ ltrim($_SERVER['argv'][$i], '-') ] = 
> $_SERVER['argv'][$i+1];
>                 } else {
>                     $opts[ ltrim($_SERVER['argv'][$i], '-') ] = false;
>                 }
>             }
>         }
>         return $opts;
>     }
> }
> (Next line is: $opts = getopt('v:t:r:sf'); )
> However, I cant override the 60second execution time it seems(and dont 
> feel like changing the php.ini as endless loops are anoying), it still 
> kills the script after 60 seconds no matter what, So looks like i'll 
> give it another miss until php 5.3 comes out.
> On Wed, 02 Apr 2008 10:46:02 +1100, Jacob Santos 
> <wordpress at santosj.name> wrote:
>> http://wordpress.svn.dragonu.net/WPTests - Subversion checkout
>> Run patch_cron.php, which will patch the wp-cron.php file in your
>> wordpress folder.
>> There is a test that will fail. You can either hack
>> run-tests/wordpress.php in order to set the Test Known bugs to false, or
>> you can go to that test case and type
>> $this->markTestSkipped();
>> Once the issues are fixed and no fatal errors are occurring, then go to
>> run-tests/wordpress.php in your browser or CLI and wait until it is
>> finished.
>> You will need PHP5.1 and PDO SQLite extension enabled.
>> Then check the index. It would be better to have run-tests/wordpress.php
>> in a browser or tab on its own so you can keep hitting it.
>> PHP 5.3 should be coming out very soon.
>>> Do you by any chance have a patch to allow us windows users to run the
>>> tests?
>>> until PHP 5.3 comes out, in its current form it doesnt support windows,
>>> And i've not had the time(or want) to hack it up to run as expected.
>>> On Wed, 02 Apr 2008 10:21:43 +1100, Jacob Santos 
>>> <wordpress at santosj.name>
>>> wrote:
>>>>> Hash: SHA1
>>>>> Nikolay Bachiyski wrote:
>>>>> | 2008/4/1, Jacob Santos <wordpress at santosj.name>:
>>>>> |> I don't want to step out of line with a statement I was going to
>>>>> make
>>>>> on
>>>>> |>  my blog, but seriously how many core developers which commit
>>>>> patches
>>>>> |>  actually test it with the Automattic WordPress Tests [1]?
>>>>> |>
>>>>> |>  How many contributors have the Subversion checkout of the
>>>>> Automattic
>>>>> |>  WordPress Tests and run it with patches?
>>>>> |
>>>>> | I do.
>>>>> |
>>>>> I don't ........ yet.
>>>>> It is on my todo list to get this setup so that I can run the test
>>>>> suite
>>>>> against patches.
>>>> So, it is basically you checkout the SVN repository, add your test 
>>>> suite
>>>> apply the patch, and then run the CLI file in the Automattic WordPress
>>>> Tests repository.
>>>> I was able to do that in several minutes. Give or take modifying 
>>>> the CLI
>>>> to work with the web, which was a two weekend project.
>>>>> It is also my intent to push for test cases before committing when
>>>>> people want to change the behaviour of complex code - autop for
>>>>> example.
>>>> Hooray! I think the intent should be on only committing code which has
>>>> documentation (even if it is from a core commit member) and has a test
>>>> case. It'll be a pain, so I do think it should be a recommendation 
>>>> until
>>>> which time more contributors are comfortable with it. I say that from
>>>> how
>>>> much I originally fought such a requirement, but the only reason I did
>>>> it
>>>> was because I really wanted to work on the project.
>>>> I'm not sure if I would work on WordPress, because it is not as fun as
>>>> game development (but somehow holds my interest better than game
>>>> development, so figure that out for me).
>>>>> I already have a number of useful scripts I use to increase my
>>>>> productivity when reviewing patches (which I must share sometime) and
>>>>> adding one which allows me to run all the (relevant) test cases 
>>>>> against
>>>>> a patch is where I would like to be :-)
>>>> Yeah, you are looking for a Continuous Integration package. There is
>>>> Bitten, which probably isn't intelligent enough at this moment and 
>>>> there
>>>> is phpUnderControl, which uses CruiseControl. The Automattic WordPress
>>>> Tests do not currently do that and my tool does not do that. With as
>>>> many
>>>> tests that could be when all of the functions are tested, it will 
>>>> be an
>>>> excellent idea to do that in the future.
>>>> I'm currently looking at Continuous Integration packages, which are 
>>>> free
>>>> and wouldn't be difficult to do for WordPress.
>>>>> Some questions for those of you more up-to-speed with the test cases.
>>>>> What are the prerequisites to getting the tests up and running 
>>>>> over and
>>>>> above what WordPress itself requires?
>>>> Automattic WordPress Tests
>>>> Linux (PHP 5.3 for Windows)
>>>> PHPUnit, might need an older version if using PHP4.
>>>> PHP4 or PHP5 with the current version of PHPUnit.
>>>> WPTests @ http://wptests.dragonu.net
>>>> Web Server
>>>> PDO_SQLite
>>>> PHP5.1+
>>>> Add yourself to Allowed Hosts in the .htaccess file.
>>>> WPTests is actually sort of a continuous integration like system, but
>>>> not,
>>>> so it isn't meant to do much of what another project will allow you to
>>>> do.
>>>> It is meant to just be on a web server and hit with a cron job or
>>>> scheduled script and go to once in a while to see the results.
>>>>> How long do the tests take to run?
>>>> Just go to the web site and it will tell you. It is off by a minute,
>>>> which
>>>> I plan on fixing, but the PHPUnit results will tell you.
>>>> It is anywhere (on my host) from 2 minutes to 7 minutes. On my machine
>>>> it
>>>> usually takes the same amount of time.
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


Jacob Santos

http://www.santosj.name - blog
http://funcdoc.wordpress.com - WordPress Documentation Blog/Guide Licensed under GPLv2

Also known as darkdragon and santosj on WP trac.

More information about the wp-hackers mailing list