This overrides the version string stored in the database with --record.
When using git-svn, you can do
php maintenance/parserTests.php --quick --quiet --record \
--setversion=`git rev-parse HEAD`
to have comprehensible version info stored for the purposes of later
bisection. Previously just "1.16alpha" would be stored, which is
useless for tracking down the old revision -- you'd have to try guessing
based on date.
It might be useful for SpecialVersion::getVersion() to support git-svn,
but that's a more complicated and intrusive change for an admittedly
small minority, so I avoided it for now.
/** */
$options = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record' );
/** */
$options = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record' );
-$optionsWithArgs = array( 'regex', 'seed' );
+$optionsWithArgs = array( 'regex', 'seed', 'setversion' );
require_once( 'commandLine.inc' );
require_once( "$IP/maintenance/parserTestsParserHook.php" );
require_once( 'commandLine.inc' );
require_once( "$IP/maintenance/parserTestsParserHook.php" );
* and all that fun stuff
*/
function start() {
* and all that fun stuff
*/
function start() {
- global $wgDBtype, $wgDBprefix;
+ global $wgDBtype, $wgDBprefix, $options;
$this->db->begin();
if( ! $this->db->tableExists( 'testrun' )
$this->db->begin();
if( ! $this->db->tableExists( 'testrun' )
$this->db->insert( 'testrun',
array(
'tr_date' => $this->db->timestamp(),
$this->db->insert( 'testrun',
array(
'tr_date' => $this->db->timestamp(),
- 'tr_mw_version' => SpecialVersion::getVersion(),
+ 'tr_mw_version' => isset( $options['setversion'] ) ?
+ $options['setversion'] : SpecialVersion::getVersion(),
'tr_php_version' => phpversion(),
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
'tr_php_version' => phpversion(),
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
--file=<testfile> Run test cases from a custom file instead of parserTests.txt
--record Record tests in database
--compare Compare with recorded results, without updating the database.
--file=<testfile> Run test cases from a custom file instead of parserTests.txt
--record Record tests in database
--compare Compare with recorded results, without updating the database.
+ --setversion When using --record, set the version string to use (useful
+ with git-svn so that you can get the exact revision)
--keep-uploads Re-use the same upload directory for each test, don't delete it
--fuzz Do a fuzz test instead of a normal test
--seed <n> Start the fuzz test from the specified seed
--keep-uploads Re-use the same upload directory for each test, don't delete it
--fuzz Do a fuzz test instead of a normal test
--seed <n> Start the fuzz test from the specified seed