Page MenuHomePhabricator

ReportIncident PHPUnit tests fail when CommunityConfiguration is not present
Open, LowPublic

Description

ReportIncident extension does not require CommunityConfiguration in extension.json. Running the PHPUnit tests fail with:

```counterexample
PHP Fatal error:  Uncaught Error: Class "MediaWiki\Extension\CommunityConfiguration\Tests\SchemaProviderTestCase" not found
in extensions/ReportIncident/tests/phpunit/integration/Config/ReportIncidentSchemaProviderTest.php:12
#0 vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once() 
#1 vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load()
#2 vendor/phpunit/phpunit/src/Framework/TestSuite.php(398): PHPUnit\Util\FileLoader::checkAndLoad()
#3 vendor/phpunit/phpunit/src/Framework/TestSuite.php(537): PHPUnit\Framework\TestSuite->addTestFile()
#4 tests/phpunit/suites/ExtensionsTestSuite.php(37): PHPUnit\Framework\TestSuite->addTestFiles()
#5 tests/phpunit/suites/ExtensionsTestSuite.php(46): ExtensionsTestSuite->__construct()
#6 [internal function]: ExtensionsTestSuite::suite()
#7 vendor/phpunit/phpunit/src/Framework/TestSuite.php(486): ReflectionMethod->invoke()
#8 vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php(84): PHPUnit\Framework\TestSuite->addTestFile()
#9 vendor/phpunit/phpunit/src/TextUI/Command.php(393): PHPUnit\TextUI\TestSuiteMapper->map()
#10 vendor/phpunit/phpunit/src/TextUI/Command.php(114): PHPUnit\TextUI\Command->handleArguments()
#11 vendor/phpunit/phpunit/src/TextUI/Command.php(99): PHPUnit\TextUI\Command->run()
#12 vendor/phpunit/phpunit/phpunit(107): PHPUnit\TextUI\Command::main()
#13 vendor/bin/phpunit(122): include('...') 
#14 {main}

See also T410051: Babel tests fail when CommunityConfiguration is not present

Event Timeline

Dreamy_Jazz subscribed.

AFAICS this will require Growth-Team to define a standard way for loading these tests which does not require extending a class from the MediaWiki-extensions-CommunityConfiguration extension. As it stands there is no way for us to update Incident-Reporting-System to skip the tests if MediaWiki-extensions-CommunityConfiguration is not installed.

Therefore, not much Product Safety and Integrity can do on this until that has been decided.