Last modified: 2014-10-23 19:54:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72630, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70630 - Reduce duplication for UnitTestList hook in extensions
Reduce duplication for UnitTestList hook in extensions
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.24rc
All All
: Low normal (vote)
: 1.24.0 release
Assigned To: Adam Wight
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-09 21:35 UTC by Kunal Mehta (Legoktm)
Modified: 2014-10-23 19:54 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2014-09-09 21:35:46 UTC
Most extensions use the same implementation of the UnitTestList hook (eg: https://github.com/wikimedia/mediawiki-extensions-Thanks/blob/master/Thanks.hooks.php#L245).

Some just use a plain glob() which is nice until someone adds a subdirectory in tests/ and tests look like they're passing but they're actually not even being run.

My idea is that we just turn that into a closure passed with the hook, so the subscriber simply becomes:

public static function registerUnitTests( array &$files, Closure $recursiveFinder ) {
	$files += $recursiveFinder( __DIR__ . '/tests' );
	return true;
}

Or something.
Comment 1 Adam Wight 2014-10-17 22:33:38 UTC
Yes! Here's a patch that should help:
https://gerrit.wikimedia.org/r/163528
Comment 2 Gerrit Notification Bot 2014-10-21 09:37:13 UTC
Change 163528 had a related patch set uploaded by Hashar:
Extensions may add tests by directory

https://gerrit.wikimedia.org/r/163528
Comment 3 Gerrit Notification Bot 2014-10-21 11:37:05 UTC
Change 163528 merged by jenkins-bot:
Extensions may add tests by directory

https://gerrit.wikimedia.org/r/163528
Comment 4 Gerrit Notification Bot 2014-10-22 22:48:49 UTC
Change 168207 had a related patch set uploaded by Awight:
Extensions may add tests by directory

https://gerrit.wikimedia.org/r/168207
Comment 5 Gerrit Notification Bot 2014-10-23 16:37:05 UTC
Change 168207 merged by jenkins-bot:
Extensions may add tests by directory

https://gerrit.wikimedia.org/r/168207
Comment 6 Umherirrender 2014-10-23 19:54:00 UTC
Was backported, so setting milestone 1.24

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links