Skip to content

Commit 9f1e03c

Browse files
authored
Fix CI (#84)
1 parent 41f4ef7 commit 9f1e03c

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

catalog-info.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ spec:
2828
spec:
2929
repository: elastic/elasticsearch-serverless-python
3030
pipeline_file: .buildkite/rest-tests.yaml
31+
env:
32+
SLACK_NOTIFICATIONS_CHANNEL: '#devtools-notify-python'
33+
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
3134
teams:
3235
devtools-team:
3336
access_level: MANAGE_BUILD_AND_READ

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717

1818
import asyncio
19-
import sys
2019
from datetime import datetime, timedelta, timezone
2120
from unittest.mock import MagicMock, call, patch
2221

@@ -31,11 +30,6 @@
3130
pytestmark = [pytest.mark.asyncio]
3231

3332

34-
async_bulk_xfail = pytest.mark.xfail(
35-
sys.version_info < (3, 11), reason="Investigated in issue #62"
36-
)
37-
38-
3933
class AsyncMock(MagicMock):
4034
async def __call__(self, *args, **kwargs):
4135
return super(AsyncMock, self).__call__(*args, **kwargs)
@@ -82,7 +76,6 @@ async def test_actions_remain_unchanged(self, async_client):
8276
assert ok
8377
assert [{"_id": 1}, {"_id": 2}] == actions
8478

85-
@async_bulk_xfail
8679
async def test_all_documents_get_inserted(self, async_client):
8780
docs = [{"answer": x, "_id": x} for x in range(100)]
8881
async for ok, item in helpers.async_streaming_bulk(
@@ -95,7 +88,6 @@ async def test_all_documents_get_inserted(self, async_client):
9588
"_source"
9689
]
9790

98-
@async_bulk_xfail
9991
async def test_documents_data_types(self, async_client):
10092
async def async_gen():
10193
for x in range(100):
@@ -314,7 +306,6 @@ async def test_bulk_works_with_single_item(self, async_client):
314306
"_source"
315307
]
316308

317-
@async_bulk_xfail
318309
async def test_all_documents_get_inserted(self, async_client):
319310
docs = [{"answer": x, "_id": x} for x in range(100)]
320311
success, failed = await helpers.async_bulk(
@@ -328,7 +319,6 @@ async def test_all_documents_get_inserted(self, async_client):
328319
"_source"
329320
]
330321

331-
@async_bulk_xfail
332322
async def test_stats_only_reports_numbers(self, async_client):
333323
docs = [{"answer": x} for x in range(100)]
334324
success, failed = await helpers.async_bulk(
@@ -369,6 +359,10 @@ async def test_error_is_raised(self, async_client):
369359
await helpers.async_bulk(async_client, [{"a": 42}, {"a": "c"}], index="i")
370360

371361
async def test_ignore_error_if_raised(self, async_client):
362+
await async_client.indices.create(
363+
index="i", mappings={"properties": {"a": {"type": "long"}}}
364+
)
365+
372366
# ignore the status code 400 in tuple
373367
await helpers.async_bulk(
374368
async_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,)
@@ -464,7 +458,6 @@ async def scan_teardown(async_client):
464458

465459

466460
class TestScan(object):
467-
@async_bulk_xfail
468461
async def test_order_can_be_preserved(self, async_client, scan_teardown):
469462
bulk = []
470463
for x in range(100):
@@ -486,7 +479,6 @@ async def test_order_can_be_preserved(self, async_client, scan_teardown):
486479
assert list(map(str, range(100))) == list(d["_id"] for d in docs)
487480
assert list(range(100)) == list(d["_source"]["answer"] for d in docs)
488481

489-
@async_bulk_xfail
490482
async def test_all_documents_are_read(self, async_client, scan_teardown):
491483
bulk = []
492484
for x in range(100):
@@ -898,7 +890,6 @@ async def reindex_setup(async_client):
898890

899891

900892
class TestReindex(object):
901-
@async_bulk_xfail
902893
async def test_reindex_passes_kwargs_to_scan_and_bulk(
903894
self, async_client, reindex_setup
904895
):
@@ -920,7 +911,6 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk(
920911
await async_client.get(index="prod_index", id=42)
921912
)["_source"]
922913

923-
@async_bulk_xfail
924914
async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
925915
await helpers.async_reindex(
926916
async_client,
@@ -940,7 +930,6 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
940930
await async_client.get(index="prod_index", id=42)
941931
)["_source"]
942932

943-
@async_bulk_xfail
944933
async def test_all_documents_get_moved(self, async_client, reindex_setup):
945934
await helpers.async_reindex(
946935
async_client, "test_index", "prod_index", bulk_kwargs={"refresh": True}
@@ -991,7 +980,6 @@ async def reindex_data_stream_setup(async_client):
991980

992981
class TestAsyncDataStreamReindex(object):
993982
@pytest.mark.parametrize("op_type", [None, "create"])
994-
@async_bulk_xfail
995983
async def test_reindex_index_datastream(
996984
self, op_type, async_client, reindex_data_stream_setup
997985
):
@@ -1011,7 +999,6 @@ async def test_reindex_index_datastream(
1011999
]
10121000
)
10131001

1014-
@async_bulk_xfail
10151002
async def test_reindex_index_datastream_op_type_index(
10161003
self, async_client, reindex_data_stream_setup
10171004
):

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ def test_error_is_raised(sync_client):
356356

357357

358358
def test_ignore_error_if_raised(sync_client):
359+
sync_client.indices.create(
360+
index="i", mappings={"properties": {"a": {"type": "long"}}}
361+
)
362+
359363
# ignore the status code 400 in tuple
360364
helpers.bulk(sync_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,))
361365

test_elasticsearch_serverless/test_server/test_rest_api_spec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
"logstash/10_basic",
108108
"scroll/10_basic",
109109
"security/10_api_key_basic",
110+
"machine_learning/jobs_crud[0]",
110111
}
111112
SKIPPED_TESTS = {
112113
# Timeouts with async client

test_elasticsearch_serverless/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ def is_xpack_template(name):
172172
"traces-apm@mappings",
173173
"traces-apm.rum@mappings",
174174
"traces@mappings",
175+
"traces@settings",
176+
# otel
177+
"metrics-otel@mappings",
178+
"semconv-resource-to-ecs@mappings",
179+
"traces-otel@mappings",
180+
"ecs-tsdb@mappings",
181+
"logs-otel@mappings",
182+
"otel@mappings",
175183
}:
176184
return True
177185
return False

0 commit comments

Comments
 (0)