Page MenuHomePhabricator

Do not take no result from composer test as success for jenkins
Closed, DeclinedPublic

Description

Some extension are autoloading php files which contains a die for non-mediawiki environment like it is happen when running "composer test". It is possible for jenkins to take a die of composer test as failure?

I am not sure if that is possible, would be nice if possible but it also okay to wontfix this task.

Example:
https://integration.wikimedia.org/ci/job/mwext-testextension-hhvm-composer-jessie/7250/console

17:05:16 + composer --ansi test
17:05:18 > parallel-lint . --exclude vendor
17:05:18 This version of the BlueSpiceEditNotifyConnector extension requires MediaWiki 1.25+[mwext-testextension-hhvm-composer-jessie] $ /bin/bash -xe /tmp/hudson1773069237167295866.sh
17:05:18 + git -C src/extensions/BlueSpiceEditNotifyConnector clean -xqdf
17:05:18 [mwext-testextension-hhvm-composer-jessie] $ /bin/bash -xe /tmp/hudson1316596872851084922.sh
17:05:18 + /srv/deployment/integration/slave-scripts/bin/mw-run-phpunit-allexts.sh
17:05:18 + cd /home/jenkins/workspace/mwext-testextension-hhvm-composer-jessie/src/tests/phpunit
17:05:18

Event Timeline

Maybe instead of using die for this we can do:

echo "This version of the BlueSpiceEditNotifyConnector extension requires MediaWiki 1.25+";
exit( 1 );

And because of the non-zero exit code composer test will fail too.

That sounds not for a generic solution.
When composer ends with a "normally" exit code of 0, there is no way to detect.

Only grepping for a composer end line from it's output, but that sound not like stable solution for new versions.
Shutdown functions can also not detect this situation (from my point of view).

phpunit has the same problem, because when the engine exits than nothing could be done