Page MenuHomePhabricator

"Failed assering that $jsonFilePath did not pass validation"
Closed, ResolvedPublic

Description

01:56:49 Failed asserting that '/workspace/src/extensions/NavigationTiming/extension.json did not pass validation.\n

This error doesn't make a lot of sense, so we should probably tidy it up

This is a mix of the phpunit assertion and code in ExtensionJsonValidator.php

https://github.com/wikimedia/mediawiki/blob/467a4f32b0475fd2840264ada94e3ce87518d22a/includes/registration/ExtensionJsonValidator.php#L157

		$out = "$path did not pass validation.\n";
		foreach ( $validator->getErrors() as $error ) {
			$out .= "[{$error['property']}] {$error['message']}\n";
		}
		if ( $extraErrors ) {
			$out .= implode( "\n", $extraErrors ) . "\n";
		}
		throw new ExtensionJsonValidationError( $out );

Event Timeline

Reedy triaged this task as Low priority.Feb 11 2021, 9:11 PM
Reedy updated the task description. (Show Details)
Reedy added a subscriber: Legoktm.

The error message is not complete here. There's '... is false' at the end. The full message should be something like

Failed asserting that {$exception->getMessage} is false

But the the test is broken anyway... it fails for logic error not for the validation reason it's meant to fail for.

Change 663805 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Fix broken test in ExtensionJsonValidation test

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

Change 663805 merged by jenkins-bot:
[mediawiki/core@master] Fix error message in ExtensionJsonValidation test

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

Change 663744 had a related patch set uploaded (by Legoktm; owner: Ammarpad):
[mediawiki/core@REL1_35] Fix error message in ExtensionJsonValidation test

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

Change 663744 merged by jenkins-bot:
[mediawiki/core@REL1_35] Fix error message in ExtensionJsonValidation test

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

Legoktm assigned this task to Ammarpad.