opendatahub-io / caikit-nlp-client

A grpc and http client library for caikit-nlp
Apache License 2.0
3 stars 6 forks source link

tests: implement mocking #15

Closed dtrifiro closed 1 year ago

dtrifiro commented 1 year ago

By mocking TGISGenerationClient we can avoid having to call real models to generate results (and having to setup a TGIS remote).

Please note that there's quite a bit of logic in the streaming endpoint mocking, which we should simplify as much as possible in the future.

z103cb commented 1 year ago

This is looking promising, we should also add the caikit_nlp.* module to the exclusion list for the linter.

dtrifiro commented 1 year ago

@vaibhavjainwiz @z103cb mocking seems to work. I marked the http streaming endpoint tests are xfail because the implementation seems broken.

I'm not 100% sure about how we mock the stream endpoint, there's a lot of logic.

One issue I have not worked out yet is that the tests are sometime hanging, but it seems to be related to one of the streaming tests.