In trying to submit https://gerrit.wikimedia.org/r/#/c/63907/18, I get a Jenkins build failure due to PHPUnit failing, due to a Fatal being thrown: https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-testextensions...
The fatal:
PHP Fatal error: Class 'MFMockRevision' not found in /srv/ssd/jenkins/workspace/mwext-MobileFrontend-testextensions-master/extensions/MobileFrontend/tests/MobileContextTest.php on line 500
The thing is, 'MFMockRevision' should be made available by it's file being included in efExtMobileFrontendUnitTests() (our hook handler for UnitTestsList.
Unit tests execute fine for me and at least one other person on the mobile team. I do not want to manually merge that patchset since I imagine it would cause build failures on subsequent patchset +2's. Anyone know what might be going on?
On 05/23/2013 04:59 PM, Arthur Richards wrote:
In trying to submit https://gerrit.wikimedia.org/r/#/c/63907/18, I get a Jenkins build failure due to PHPUnit failing, due to a Fatal being thrown: https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-testextensions...
The fatal:
PHP Fatal error: Class 'MFMockRevision' not found in /srv/ssd/jenkins/workspace/mwext-MobileFrontend-testextensions-master/extensions/MobileFrontend/tests/MobileContextTest.php on line 500
My guess is you need to add it to $autoloadClasses.
The thing is, 'MFMockRevision' should be made available by it's file being included in efExtMobileFrontendUnitTests() (our hook handler for UnitTestsList.
I don't know if Jenkins uses that. Moreover, it doesn't seem correct to add it there, since that file doesn't actually have tests in it.
Matt Flaschen
On Thu, May 23, 2013 at 1:59 PM, Arthur Richards arichards@wikimedia.orgwrote:
In trying to submit https://gerrit.wikimedia.org/r/#/c/63907/18, I get a Jenkins build failure due to PHPUnit failing, due to a Fatal being thrown:
https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-testextensions...
The fatal:
PHP Fatal error: Class 'MFMockRevision' not found in /srv/ssd/jenkins/workspace/mwext-MobileFrontend-testextensions-master/extensions/MobileFrontend/tests/MobileContextTest.php on line 500
The thing is, 'MFMockRevision' should be made available by it's file being included in efExtMobileFrontendUnitTests() (our hook handler for UnitTestsList.
Unit tests execute fine for me and at least one other person on the mobile team. I do not want to manually merge that patchset since I imagine it would cause build failures on subsequent patchset +2's. Anyone know what might be going on?
-- Arthur Richards Software Engineer, Mobile [[User:Awjrichards]] IRC: awjr +1-415-839-6885 x6687
After some digging it became obvious that adding classes that are not test cases using 'UnitTestsList' just doesn't work since PHPUnit will only actually add the files that contain test cases. I instead tried using $wgAutoloadClasses inside of efExtMobileFrontendUnitTests() to load the extra helper class, but that didn't seem to work either :( Ultimately, I rewrote how the tests work and merged the helper class into the same file containing the test case that relied on it. But for the future, is there a better way to include arbitrary, non-PHPUnit test case classes in test runs?
On Fri, May 24, 2013 at 2:29 AM, Arthur Richards arichards@wikimedia.org wrote:
After some digging it became obvious that adding classes that are not test cases using 'UnitTestsList' just doesn't work since PHPUnit will only actually add the files that contain test cases.
Actually, it depends on how you run PHPUnit on your extension.
If you do 'php phpunit.php /path/to/your/extension/', it will add any file ending in "Test.php" that seems to contain a unit test.
If you do 'php phpunit.php --filter ExtensionName', it will use the UnitTestsList hook.
wikitech-l@lists.wikimedia.org