Page MenuHomePhabricator

LuaEngineTestSkip.php marked as risky when run in phpunit
Closed, ResolvedPublic

Description

Running Scribunto's LuaEngineTestSkip testcase from phpunit causes phpunit to exit with a status of 1 because the testcase has no covers annotation:

$ ./vendor/bin/phpunit extensions/Scribunto/tests/phpunit/Engines/LuaCommon/LuaEngineTestSkip.php
Using PHP 7.4.33
Running with MediaWiki settings because there might be integration tests
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

R                                                                   1 / 1 (100%)

Time: 00:00.006, Memory: 34.50 MB

There was 1 risky test:

1) 
This test does not have a @covers annotation but is expected to have one

phpvfscomposer:///workspace/src/vendor/phpunit/phpunit/phpunit:106

OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 1, Risky: 1.

Add @coversNothing so that phpunit doesn't complain.

Event Timeline

Change #1035728 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Scribunto@master] Add coversNothing annotation to LuaEngineTestSkip

https://gerrit.wikimedia.org/r/1035728

Change #1035728 abandoned by Arthur taylor:

[mediawiki/extensions/Scribunto@master] Add coversNothing annotation to LuaEngineTestSkip

Reason:

Is not a real test - shouldn't be run from phpunit

https://gerrit.wikimedia.org/r/1035728

Okay - looks like the right thing to do here is just not to run this as a test case. Let's try that instead.

(restoring assignee after column trigger unintentionally cleared it)