Skip to content

Commit cc6b04e

Browse files
committed
Remove parent/child tests
Using a join type requires the routing field which is forbidden in serverless. Using this feature isn't really recommended anyway. https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
1 parent 1afa78a commit cc6b04e

File tree

2 files changed

+0
-115
lines changed

2 files changed

+0
-115
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -942,66 +942,6 @@ async def test_all_documents_get_moved(self, async_client, reindex_setup):
942942
)["_source"]
943943

944944

945-
@pytest_asyncio.fixture(scope="function")
946-
async def parent_reindex_setup(async_client):
947-
body = {
948-
"mappings": {
949-
"properties": {
950-
"question_answer": {
951-
"type": "join",
952-
"relations": {"question": "answer"},
953-
}
954-
}
955-
},
956-
}
957-
await async_client.indices.create(index="test-index", body=body)
958-
await async_client.indices.create(index="real-index", body=body)
959-
960-
await async_client.index(
961-
index="test-index", id=42, body={"question_answer": "question"}
962-
)
963-
await async_client.index(
964-
index="test-index",
965-
id=47,
966-
routing=42,
967-
body={"some": "data", "question_answer": {"name": "answer", "parent": 42}},
968-
refresh=True,
969-
)
970-
971-
972-
class TestParentChildReindex:
973-
async def test_children_are_reindexed_correctly(
974-
self, async_client, parent_reindex_setup
975-
):
976-
await helpers.async_reindex(async_client, "test-index", "real-index")
977-
978-
q = await async_client.get(index="real-index", id=42)
979-
assert {
980-
"_id": "42",
981-
"_index": "real-index",
982-
"_primary_term": 1,
983-
"_seq_no": 0,
984-
"_source": {"question_answer": "question"},
985-
"_version": 1,
986-
"found": True,
987-
} == q
988-
989-
q = await async_client.get(index="test-index", id=47, routing=42)
990-
assert {
991-
"_routing": "42",
992-
"_id": "47",
993-
"_index": "test-index",
994-
"_primary_term": 1,
995-
"_seq_no": 1,
996-
"_source": {
997-
"some": "data",
998-
"question_answer": {"name": "answer", "parent": 42},
999-
},
1000-
"_version": 1,
1001-
"found": True,
1002-
} == q
1003-
1004-
1005945
@pytest_asyncio.fixture(scope="function")
1006946
async def reindex_data_stream_setup(async_client):
1007947
dt = datetime.now(tz=timezone.utc)

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -889,61 +889,6 @@ def test_all_documents_get_moved(sync_client):
889889
)["_source"]
890890

891891

892-
@pytest.fixture(scope="function")
893-
def parent_child_reindex_setup(sync_client):
894-
body = {
895-
"mappings": {
896-
"properties": {
897-
"question_answer": {
898-
"type": "join",
899-
"relations": {"question": "answer"},
900-
}
901-
}
902-
},
903-
}
904-
sync_client.indices.create(index="test-index", body=body)
905-
sync_client.indices.create(index="real-index", body=body)
906-
907-
sync_client.index(index="test-index", id=42, body={"question_answer": "question"})
908-
sync_client.index(
909-
index="test-index",
910-
id=47,
911-
routing=42,
912-
body={"some": "data", "question_answer": {"name": "answer", "parent": 42}},
913-
refresh=True,
914-
)
915-
916-
917-
@pytest.mark.usefixtures("parent_child_reindex_setup")
918-
def test_children_are_reindexed_correctly(sync_client):
919-
helpers.reindex(sync_client, "test-index", "real-index")
920-
921-
q = sync_client.get(index="real-index", id=42)
922-
assert {
923-
"_id": "42",
924-
"_index": "real-index",
925-
"_primary_term": 1,
926-
"_seq_no": 0,
927-
"_source": {"question_answer": "question"},
928-
"_version": 1,
929-
"found": True,
930-
} == q
931-
q = sync_client.get(index="test-index", id=47, routing=42)
932-
assert {
933-
"_routing": "42",
934-
"_id": "47",
935-
"_index": "test-index",
936-
"_primary_term": 1,
937-
"_seq_no": 1,
938-
"_source": {
939-
"some": "data",
940-
"question_answer": {"name": "answer", "parent": 42},
941-
},
942-
"_version": 1,
943-
"found": True,
944-
} == q
945-
946-
947892
@pytest.fixture(scope="function")
948893
def reindex_data_stream_setup(sync_client):
949894
dt = datetime.now(tz=tz.UTC)

0 commit comments

Comments
 (0)