Page MenuHomePhabricator

Rework/rewrite the wikilambda_perform_test API
Closed, ResolvedPublic

Description

Description

The WikiLambda API wikilambda_perform_test (https://www.mediawiki.org/wiki/Extension:WikiLambda/API#wikilambda_perform_test) is currently not working, as every test is returning a

{"Z1K1":"Z5","Z5K1":"Z507","Z5K2":{"Z1K1":{"Z1K1":"Z7","Z7K1":"Z885","Z885K1":"Z507"},"K1":{"Z1K1":"Z7","Z7K1":{"Z1K1":"Z8","Z8K1":["Z17",{"Z1K1":"Z17","Z17K1":"Z10000","Z17K2":"Z10001K1","Z17K3":{"Z1K1":"Z12","Z12K1":["Z11",{"Z1K1":"Z11","Z11K1":"Z1003","Z11K2":"seta"},{"Z1K1":"Z11","Z11K1":"Z1002","Z11K2":"mushroom"}]}}],"Z8K2":"Z6","Z8K3":["Z20","Z10004"],"Z8K4":["Z14","Z10003"],"Z8K5":"Z10001"},"Z10001K1":"Z10002"},"K2":{"Z1K1":"Z5","Z5K1":"Z500","Z5K2":{"Z1K1":{"Z1K1":"Z7","Z7K1":"Z885","Z885K1":"Z500"},"K1":"Key value not wellformed"}}}}

This error is returned even when the wikilambda_function_call API can perfectly run and return the expected result of both test steps:

  • Run the tester function call
  • Run the validator function on the outcome

All the testers from the function page Details table are currently being shown in Failure state.

Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)


Completion checklist

Event Timeline

Note also that substantial work was done fairly recently on APIPerformTest.php, and also some changes in the Vue file that calls the API:
T309069. Happy to answer questions related to that work.

I can't currently reproduce the bug with this API method - every test I throw at the API is performed correctly. But the task to rework the API still stands.

Both wikilambda_perform_test&wikilambda_perform_test_zfunction=Z10014 (the documented example call) and wikilambda_perform_test&wikilambda_perform_test_zfunction=Z801 (the one we probably should actually document) work fine, as do the '<URL_ENCODED_JSON_FUNCTION>' ones in that documentation now that Edmund's great work is landed.

Is this task now just "update the on-wiki documentation"?

WikiLambda's ApiPerformTest.php uses the function-orchestrator /evaluate/ entrypoint to first run and then validate a tester

I did this work in June. What's the DoD here?

Hi @EWright-WMF and @Jdforrester-WMF , wikilambda_perform_test&wikilambda_perform_test_zfunction=Z801 does not appear to be working at present. Has there been a regression or is beta currently broken? The output is hard to read, but I still see "Key value not wellformed" in there. By visiting https://wikifunctions.beta.wmflabs.org/wiki/Z801?view=function-viewer, one can see 1 of the 4 tests is failing (and "Key value not wellformed" shows up in the metadata dialog).

Hi @DMartin-WMF - I can take a look at that. But given it's just one of the tests that's failing I suspect it's an issue with function orchestration or evaluation, rather than the perform test flow itself.

Hi @EWright-WMF and @Jdforrester-WMF , wikilambda_perform_test&wikilambda_perform_test_zfunction=Z801 does not appear to be working at present. Has there been a regression or is beta currently broken? The output is hard to read, but I still see "Key value not wellformed" in there. By visiting https://wikifunctions.beta.wmflabs.org/wiki/Z801?view=function-viewer, one can see 1 of the 4 tests is failing (and "Key value not wellformed" shows up in the metadata dialog).

The broken test is "meant" to be broken (until we fix it, see T299194: Test Z8013 for Z801/Echo fails). I think we can declare this Resolved once this API is better documented.

Hi @Jdforrester-WMF - I agree this probably just needs documentation updating, which I can take on.

Taking this issue led to the idea of restructuring Tester - as proposed in this doc - but I think that work should probably be in a separate issue, which I've created in T323901.

In T320509#8423903, @EWright-WMF wrote:

Hi @Jdforrester-WMF - I agree this probably just needs documentation updating, which I can take on.

Thanks!

Taking this issue led to the idea of restructuring Tester - as proposed in this doc - but I think that work should probably be in a separate issue, which I've created in T323901.

Ack. Not sure that should be automatically accepted into the current Phase without discussion first though. :-)

@Jdforrester-WMF - apologies, I didn't mean to bypass processes. I've removed the tag and will leave it to to be triaged.