Description
When calling the perform test api, for each combination of implementation/test we do:
- execute the test call
- with the response as an input, execute the validator call
However, when the test call returns an error, we send this error to the validator call.
// Execute the test case function call $testResultObject = $this->executeFunctionCall( $testFunctionCall, true ); $testMetadata = $testResultObject->getValueByKey( ZTypeRegistry::Z_RESPONSEENVELOPE_METADATA ); '@phan-var \MediaWiki\Extension\WikiLambda\ZObjects\ZTypedMap $testMetadata'; // Use tester to create a function call validating the output $validateTestValue = $testResultObject->hasErrors() ? $testResultObject->getErrors() : // <------------------------------- HERE. BAD DECISION. $testResultObject->getZValue(); $validateFunctionCall = $testerObject->getValueByKey( ZTypeRegistry::Z_TESTER_VALIDATION ); '@phan-var \MediaWiki\Extension\WikiLambda\ZObjects\ZFunctionCall $validateFunctionCall'; $targetValidationFunctionZID = $validateFunctionCall->getZValue(); $validateFunctionCall->setValueByKey( $targetValidationFunctionZID . 'K1', $validateTestValue ); // Execute the validation function call and stash it $validateResult = $this->executeFunctionCall( $validateFunctionCall, false );
Sometimes the error returned is extremely large, so the second call throws a "request entity too large" 500 error, which breaks everything.
Expected behavior (Acceptance criteria):
- When the first call returns an error, we shouldn't validate the error, but the response
- TODO (for the future) We should build a system that can check for errors (expect error Z* function),
- If this function is used in the validator call, then take a different path for checking the error and args, instead of making it the orchestrator responsibility
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist