opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
350 stars 175 forks source link

[FEATURE] Generated tests for generated code #521

Open VachaShah opened 1 year ago

VachaShah commented 1 year ago

Coming from https://github.com/opensearch-project/opensearch-py/pull/511#pullrequestreview-1655403319, as @dblock suggested, we should have tests for all the generated code we are putting in, starting with some basic tests that are also generated.

saimedhi commented 1 year ago

I recommend using this Yaml test runner for integration tests. https://github.com/opensearch-project/opensearch-py/blob/main/test_opensearchpy/test_server/test_rest_api_spec.py

VachaShah commented 1 year ago

@saimedhi Can we generate some tests from this?

saimedhi commented 1 year ago

The YAML test runner generates tests based on the spec https://github.com/saimedhi/OpenSearch/tree/main/rest-api-spec/src/main/resources/rest-api-spec/test These tests are stored temporarily and won't be saved. While I'm not certain if these tests can be displayed in clients, they are running and can be utilized.

dblock commented 1 year ago

I think some unit tests wouldn't hurt either.

dblock commented 12 months ago

@saimedhi Are we generating with the recent changes when a new API is added? If we do we can close this.

saimedhi commented 12 months ago

Currently tests are not generated. This needs to be done :)