r91211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91210‎ | r91211 | r91212 >
Date:19:47, 30 June 2011
Author:demon
Status:ok
Tags:
Comment:
Remove --upload option to parserTests.php and backend RemoteTestRecorder -- was only used for since-removed CR integration
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/tests/parserTests.php (modified) (history)
  • /trunk/phase3/tests/testHelpers.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parserTests.php
@@ -51,7 +51,6 @@
5252 --seed <n> Start the fuzz test from the specified seed
5353 --help Show this help message
5454 --run-disabled run disabled tests
55 - --upload Upload test results to remote wiki (per \$wgParserTestRemote)
5655
5756 ENDS;
5857 exit( 0 );
Index: trunk/phase3/tests/testHelpers.inc
@@ -349,99 +349,6 @@
350350 }
351351 }
352352
353 -class RemoteTestRecorder extends TestRecorder {
354 - function start() {
355 - parent::start();
356 -
357 - $this->results = array();
358 - $this->ping( 'running' );
359 - }
360 -
361 - function record( $test, $result ) {
362 - parent::record( $test, $result );
363 - $this->results[$test] = (bool)$result;
364 - }
365 -
366 - function end() {
367 - $this->ping( 'complete', $this->results );
368 - parent::end();
369 - }
370 -
371 - /**
372 - * Inform a CodeReview instance that we've started or completed a test run...
373 - *
374 - * @param $status string: "running" - tell it we've started
375 - * "complete" - provide test results array
376 - * "abort" - something went horribly awry
377 - * @param $results array of test name => true/false
378 - */
379 - function ping( $status, $results = false ) {
380 - global $wgParserTestRemote, $IP;
381 -
382 - $remote = $wgParserTestRemote;
383 - $revId = SpecialVersion::getSvnRevision( $IP );
384 - $jsonResults = FormatJson::encode( $results );
385 -
386 - if ( !$remote ) {
387 - print "Can't do remote upload without configuring \$wgParserTestRemote!\n";
388 - exit( 1 );
389 - }
390 -
391 - // Generate a hash MAC to validate our credentials
392 - $message = array(
393 - $remote['repo'],
394 - $remote['suite'],
395 - $revId,
396 - $status,
397 - );
398 -
399 - if ( $status == "complete" ) {
400 - $message[] = $jsonResults;
401 - }
402 - $hmac = hash_hmac( "sha1", implode( "|", $message ), $remote['secret'] );
403 -
404 - $postData = array(
405 - 'action' => 'codetestupload',
406 - 'format' => 'json',
407 - 'repo' => $remote['repo'],
408 - 'suite' => $remote['suite'],
409 - 'rev' => $revId,
410 - 'status' => $status,
411 - 'hmac' => $hmac,
412 - );
413 -
414 - if ( $status == "complete" ) {
415 - $postData['results'] = $jsonResults;
416 - }
417 -
418 - $response = $this->post( $remote['api-url'], $postData );
419 -
420 - if ( $response === false ) {
421 - print "CodeReview info upload failed to reach server.\n";
422 - exit( 1 );
423 - }
424 -
425 - $responseData = FormatJson::decode( $response, true );
426 -
427 - if ( !is_array( $responseData ) ) {
428 - print "CodeReview API response not recognized...\n";
429 - wfDebug( "Unrecognized CodeReview API response: $response\n" );
430 - exit( 1 );
431 - }
432 -
433 - if ( isset( $responseData['error'] ) ) {
434 - $code = $responseData['error']['code'];
435 - $info = $responseData['error']['info'];
436 - print "CodeReview info upload failed: $code $info\n";
437 - exit( 1 );
438 - }
439 - }
440 -
441 - function post( $url, $data ) {
442 - return Http::post( $url, array( 'postData' => $data ) );
443 - }
444 -}
445 -
446353 class TestFileIterator implements Iterator {
447354 private $file;
448355 private $fh;
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -185,8 +185,6 @@
186186 $options['setversion'] : SpecialVersion::getVersion();
187187 } elseif ( isset( $options['compare'] ) ) {
188188 $this->recorder = new DbTestPreviewer( $this );
189 - } elseif ( isset( $options['upload'] ) ) {
190 - $this->recorder = new RemoteTestRecorder( $this );
191189 } else {
192190 $this->recorder = new TestRecorder( $this );
193191 }
Index: trunk/phase3/includes/AutoLoader.php
@@ -846,7 +846,6 @@
847847 'DbTestPreviewer' => 'tests/testHelpers.inc',
848848 'DbTestRecorder' => 'tests/testHelpers.inc',
849849 'DummyTermColorer' => 'tests/testHelpers.inc',
850 - 'RemoteTestRecorder' => 'tests/testHelpers.inc',
851850 'TestFileIterator' => 'tests/testHelpers.inc',
852851 'TestRecorder' => 'tests/testHelpers.inc',
853852

Status & tagging log