opensearch-project / opensearch-py

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

[BUG] 30_max_analyzed_offset failing #686

Closed dblock closed 6 months ago

dblock commented 6 months ago

What is the bug?

FAILED test_opensearchpy/test_server/test_rest_api_spec.py::test_rest_api_spec[OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/search/highlight/30_max_analyzed_offset[5]]

How can one reproduce the bug?

Latest builds are failing in this REST spec.

saimedhi commented 6 months ago

Additional info:

saimedhi commented 6 months ago
  • How is the opensearch-net client correctly interpreting the skip version as " - 2.12.99" even though it is currently specified as " - 2.1.99"

Got it @Xtansia! In opensearch-net's YAML test runner, tests against each opensearch version are taken from the corresponding opensearch version, such as 2.x branch when tests are run against 2.x.

On the other hand, opensearch-py uses only yaml tests from the main branch to test all opensearch versions.

Thomas, what do you think is the correct way to test? I'm inclined towards testing all opensearch versions against the opensearch main branch yaml tests. This should be the place where we'll have all the tests correctly, including skip tests that determine whether the test should be run on a particular branch or not.

dblock commented 6 months ago

If I understand correctly OpenSearch/main and 2.x are eventually consistent and should be identical? So it shouldn't matter where we take them from. However, I think it's best if we standardized on one way of doing it.

dblock commented 6 months ago

Another thought. If OpenSearch 3.x (main) removes an API, would it be deleted from main? In that case we want to take tests from 2.x.

saimedhi commented 6 months ago

Listing other failing tests against the unreleased OpenSearch main branch. Working on fixing them.

Xtansia commented 6 months ago

@dblock @saimedhi For both .NET & Rust this behaviour of picking the tests from the matching branch/revision of the OS cluster was inherited in the fork from Elastic. Even if main is eventually consistent, it seems evident that taking the tests intended for a given version will be more reliable.

dblock commented 6 months ago

Fixed in https://github.com/opensearch-project/opensearch-py/pull/696.