Page MenuHomePhabricator
Paste P7769

To find Uncaught MWException: SpecialEditWatchlistTest::tearDown() must call parent::tearDown()

Authored by RazeSoldier on Nov 7 2018, 2:21 AM.
// Get commits between 27cb4c5 and master HEAD includes the Hash
shell_exec('git checkout master');
`git log 27cb4c5..master --merges --oneline --pretty=format:"%h" --output commits.text`;
$commits = explode("\n", file_get_contents('commits.text'));
$arrLen = count($commits);
// Update dependencies first
shell_exec(`git checkout 27cb4c5`);
`composer update --prefer-source --quiet --no-interaction`;
for ($i = $arrLen; $i > 0 ; $i--) {
$current = $commits[$i-1];
shell_exec('git checkout $current');
// Checks if composer.json is change
$isChange = shell_exec("git diff HEAD^ composer.json");
if ($isChange !== null) {
// If change, update deps
`composer update --prefer-source --quiet --no-interaction`;
// Install MediaWiki
shell_exec('php maintenance/install.php CIwiki admin --pass CI --dbtype mysql --dbname CI_db --dbuser CI_user --dbpass "" --dbserver --scriptpath "/w" && echo -en "\n\nrequire_once __DIR__ . \'/includes/DevelopmentSettings.php\';\n" >> ./LocalSettings.php');
// Run PHPUnit test
shell_exec('php tests/phpunit/phpunit.php > test.log 2>&1');
$report = file_get_contents('test.log');
$pos = strpos($report, 'Uncaught MWException: SpecialEditWatchlistTest::tearDown() must call parent::tearDown()');
if ($pos === false) {
echo "We find out $current\n";
// Drop environment
shell_exec('mysql -h -u CI_user -e "drop database CI_db;"');