Skip to content

Commit aba9787

Browse files
authored
Remove parent/child tests (#45)
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 654acd1 commit aba9787

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
@@ -940,66 +940,6 @@ async def test_all_documents_get_moved(self, async_client, reindex_setup):
940940
)["_source"]
941941

942942

943-
@pytest_asyncio.fixture(scope="function")
944-
async def parent_reindex_setup(async_client):
945-
body = {
946-
"mappings": {
947-
"properties": {
948-
"question_answer": {
949-
"type": "join",
950-
"relations": {"question": "answer"},
951-
}
952-
}
953-
},
954-
}
955-
await async_client.indices.create(index="test-index", body=body)
956-
await async_client.indices.create(index="real-index", body=body)
957-
958-
await async_client.index(
959-
index="test-index", id=42, body={"question_answer": "question"}
960-
)
961-
await async_client.index(
962-
index="test-index",
963-
id=47,
964-
routing=42,
965-
body={"some": "data", "question_answer": {"name": "answer", "parent": 42}},
966-
refresh=True,
967-
)
968-
969-
970-
class TestParentChildReindex:
971-
async def test_children_are_reindexed_correctly(
972-
self, async_client, parent_reindex_setup
973-
):
974-
await helpers.async_reindex(async_client, "test-index", "real-index")
975-
976-
q = await async_client.get(index="real-index", id=42)
977-
assert {
978-
"_id": "42",
979-
"_index": "real-index",
980-
"_primary_term": 1,
981-
"_seq_no": 0,
982-
"_source": {"question_answer": "question"},
983-
"_version": 1,
984-
"found": True,
985-
} == q
986-
987-
q = await async_client.get(index="test-index", id=47, routing=42)
988-
assert {
989-
"_routing": "42",
990-
"_id": "47",
991-
"_index": "test-index",
992-
"_primary_term": 1,
993-
"_seq_no": 1,
994-
"_source": {
995-
"some": "data",
996-
"question_answer": {"name": "answer", "parent": 42},
997-
},
998-
"_version": 1,
999-
"found": True,
1000-
} == q
1001-
1002-
1003943
@pytest_asyncio.fixture(scope="function")
1004944
async def reindex_data_stream_setup(async_client):
1005945
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
@@ -887,61 +887,6 @@ def test_all_documents_get_moved(sync_client):
887887
)["_source"]
888888

889889

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

0 commit comments

Comments
 (0)