Page MenuHomePhabricator

Prepare upgrade to justinrainbow/json-schema to 6.x in CommunityConfiguration
Open, MediumPublic

Description

For the update of the justinrainbow/json-schema library in core (see parent task) several CommunityConfiguration unit tests are failing in JsonSchemaValidatorTest.php, like the following:

00:01:35.130 1) MediaWiki\Extension\CommunityConfiguration\Tests\JsonSchemaValidatorTest::testValidate with data set "wrong type" (MediaWiki\Extension\CommunityConfiguration\Schema\JsonSchema@anonymous/workspace/src/extensions/CommunityConfiguration/tests/phpunit/unit/Validation/JsonSchemaValidatorTest.php:66$27a Object (), array('baz'), false, array('type'), false, false, array(array('Number', '/Number', 'String value found, but a num...quired', array('type'))))
00:01:35.135 Failed asserting that two arrays are identical.
00:01:35.135 --- Expected
00:01:35.135 +++ Actual
00:01:35.135 @@ @@
00:01:35.135  Array &0 (
00:01:35.135 -    0 => 'type'
00:01:35.135 +    0 => Array &1 (
00:01:35.135 +        'name' => 'type'
00:01:35.135 +        'params' => Array &2 (
00:01:35.135 +            'found' => 'string'
00:01:35.135 +            'expected' => 'a number'
00:01:35.135 +        )
00:01:35.135 +    )
00:01:35.135  )
00:01:35.135 
00:01:35.135 /workspace/src/extensions/CommunityConfiguration/tests/phpunit/unit/Validation/JsonSchemaValidatorTest.php:359

We should:

  • figure out if any production code changes are required to make use of the v6 version
  • figure out how to adjust the tests so that they either work with both v5 and v6 of the library, or disable the tests, do the library update, and then reenable them for v6
  • investigate if the new version of the library contains any improvements that we may want to make use of

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1233935 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CommunityConfiguration@master] JsonSchemaValidatorTest: Update for justinrainbow/json-schema 6.x

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

Change #1233943 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CommunityConfiguration@master] JsonSchemaValidatorTest: Test for justinrainbow/json-schema 6.x

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