Description
The following phpunit test fails:
docker compose exec mediawiki composer phpunit:entrypoint -- extensions/WikiLambda/tests/phpunit/integration/API/ApiFunctionCallTest.php --filter "Invoke a function that maps the element of a typed Map at a given key to a string version of its value"
The orchestrator returns Z24 because during validateReturnType (particularly responseEnvelopeContainsValue) expects normal form, but it's receiving a mixed result from the python evaluator, like this:
"Z22K1": { "Z1K1": { // <<<<<<<<<<<<------------- Mixed form object "Z1K1": { "Z1K1": "Z9", "Z9K1": "Z7" }, "Z7K1": { "Z1K1": "Z9", "Z9K1": "Z883" }, "Z883K1": "Z6", "Z883K2": "Z6" }, "K1": { "Z1K1": { "Z1K1": { "Z1K1": "Z9", "Z9K1": "Z7" }, "Z7K1": { "Z1K1": "Z9", "Z9K1": "Z881" }, "Z881K1": { // <<<<<<<<<<<<------------- Mixed form object "Z1K1": { "Z1K1": "Z9", "Z9K1": "Z7" }, "Z7K1": { "Z1K1": "Z9", "Z9K1": "Z882" }, "Z882K1": "Z6", "Z882K2": "Z6" } }, ...
We need to:
- either allow responseEnvelopeContainsValue to function with mixed or canonical forms, or
- make sure that the python executor serializes maps and pairs in normal form
Also, re-enable the phpunit test from WikiLambda.
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#Back-end_Task/Bug_completion_checklist