diff --git a/catalog-info.yaml b/catalog-info.yaml index a2bad6e..7bac372 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -28,6 +28,9 @@ spec: spec: repository: elastic/elasticsearch-serverless-python pipeline_file: .buildkite/rest-tests.yaml + env: + SLACK_NOTIFICATIONS_CHANNEL: '#devtools-notify-python' + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' teams: devtools-team: access_level: MANAGE_BUILD_AND_READ diff --git a/test_elasticsearch_serverless/test_async/test_server/test_helpers.py b/test_elasticsearch_serverless/test_async/test_server/test_helpers.py index 68d81e6..75f988e 100644 --- a/test_elasticsearch_serverless/test_async/test_server/test_helpers.py +++ b/test_elasticsearch_serverless/test_async/test_server/test_helpers.py @@ -16,7 +16,6 @@ # under the License. import asyncio -import sys from datetime import datetime, timedelta, timezone from unittest.mock import MagicMock, call, patch @@ -31,11 +30,6 @@ pytestmark = [pytest.mark.asyncio] -async_bulk_xfail = pytest.mark.xfail( - sys.version_info < (3, 11), reason="Investigated in issue #62" -) - - class AsyncMock(MagicMock): async def __call__(self, *args, **kwargs): return super(AsyncMock, self).__call__(*args, **kwargs) @@ -82,7 +76,6 @@ async def test_actions_remain_unchanged(self, async_client): assert ok assert [{"_id": 1}, {"_id": 2}] == actions - @async_bulk_xfail async def test_all_documents_get_inserted(self, async_client): docs = [{"answer": x, "_id": x} for x in range(100)] async for ok, item in helpers.async_streaming_bulk( @@ -95,7 +88,6 @@ async def test_all_documents_get_inserted(self, async_client): "_source" ] - @async_bulk_xfail async def test_documents_data_types(self, async_client): async def async_gen(): for x in range(100): @@ -314,7 +306,6 @@ async def test_bulk_works_with_single_item(self, async_client): "_source" ] - @async_bulk_xfail async def test_all_documents_get_inserted(self, async_client): docs = [{"answer": x, "_id": x} for x in range(100)] success, failed = await helpers.async_bulk( @@ -328,7 +319,6 @@ async def test_all_documents_get_inserted(self, async_client): "_source" ] - @async_bulk_xfail async def test_stats_only_reports_numbers(self, async_client): docs = [{"answer": x} for x in range(100)] success, failed = await helpers.async_bulk( @@ -369,6 +359,10 @@ async def test_error_is_raised(self, async_client): await helpers.async_bulk(async_client, [{"a": 42}, {"a": "c"}], index="i") async def test_ignore_error_if_raised(self, async_client): + await async_client.indices.create( + index="i", mappings={"properties": {"a": {"type": "long"}}} + ) + # ignore the status code 400 in tuple await helpers.async_bulk( async_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,) @@ -464,7 +458,6 @@ async def scan_teardown(async_client): class TestScan(object): - @async_bulk_xfail async def test_order_can_be_preserved(self, async_client, scan_teardown): bulk = [] for x in range(100): @@ -486,7 +479,6 @@ async def test_order_can_be_preserved(self, async_client, scan_teardown): assert list(map(str, range(100))) == list(d["_id"] for d in docs) assert list(range(100)) == list(d["_source"]["answer"] for d in docs) - @async_bulk_xfail async def test_all_documents_are_read(self, async_client, scan_teardown): bulk = [] for x in range(100): @@ -898,7 +890,6 @@ async def reindex_setup(async_client): class TestReindex(object): - @async_bulk_xfail async def test_reindex_passes_kwargs_to_scan_and_bulk( self, async_client, reindex_setup ): @@ -920,7 +911,6 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk( await async_client.get(index="prod_index", id=42) )["_source"] - @async_bulk_xfail async def test_reindex_accepts_a_query(self, async_client, reindex_setup): await helpers.async_reindex( async_client, @@ -940,7 +930,6 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup): await async_client.get(index="prod_index", id=42) )["_source"] - @async_bulk_xfail async def test_all_documents_get_moved(self, async_client, reindex_setup): await helpers.async_reindex( async_client, "test_index", "prod_index", bulk_kwargs={"refresh": True} @@ -991,7 +980,6 @@ async def reindex_data_stream_setup(async_client): class TestAsyncDataStreamReindex(object): @pytest.mark.parametrize("op_type", [None, "create"]) - @async_bulk_xfail async def test_reindex_index_datastream( self, op_type, async_client, reindex_data_stream_setup ): @@ -1011,7 +999,6 @@ async def test_reindex_index_datastream( ] ) - @async_bulk_xfail async def test_reindex_index_datastream_op_type_index( self, async_client, reindex_data_stream_setup ): diff --git a/test_elasticsearch_serverless/test_server/test_helpers.py b/test_elasticsearch_serverless/test_server/test_helpers.py index f804866..2b83737 100644 --- a/test_elasticsearch_serverless/test_server/test_helpers.py +++ b/test_elasticsearch_serverless/test_server/test_helpers.py @@ -356,6 +356,10 @@ def test_error_is_raised(sync_client): def test_ignore_error_if_raised(sync_client): + sync_client.indices.create( + index="i", mappings={"properties": {"a": {"type": "long"}}} + ) + # ignore the status code 400 in tuple helpers.bulk(sync_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,)) diff --git a/test_elasticsearch_serverless/test_server/test_rest_api_spec.py b/test_elasticsearch_serverless/test_server/test_rest_api_spec.py index 1f3535f..35969da 100644 --- a/test_elasticsearch_serverless/test_server/test_rest_api_spec.py +++ b/test_elasticsearch_serverless/test_server/test_rest_api_spec.py @@ -107,6 +107,7 @@ "logstash/10_basic", "scroll/10_basic", "security/10_api_key_basic", + "machine_learning/jobs_crud[0]", } SKIPPED_TESTS = { # Timeouts with async client diff --git a/test_elasticsearch_serverless/utils.py b/test_elasticsearch_serverless/utils.py index 1764b82..49f7ba9 100644 --- a/test_elasticsearch_serverless/utils.py +++ b/test_elasticsearch_serverless/utils.py @@ -172,6 +172,14 @@ def is_xpack_template(name): "traces-apm@mappings", "traces-apm.rum@mappings", "traces@mappings", + "traces@settings", + # otel + "metrics-otel@mappings", + "semconv-resource-to-ecs@mappings", + "traces-otel@mappings", + "ecs-tsdb@mappings", + "logs-otel@mappings", + "otel@mappings", }: return True return False