Skip to content

Commit

Permalink
Re-enable integration tests across multiple versions of OpenSearch (#163
Browse files Browse the repository at this point in the history
)

* Re-enable integration tests for 1.x versions of OpenSearch

Signed-off-by: Vacha Shah <[email protected]>

* Fixing integ tests after re-enabling 1.x versions

Signed-off-by: Vacha Shah <[email protected]>

* Separating out versions

Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored May 3, 2022
1 parent 262f05a commit 3944cc2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 56 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ jobs:
matrix:
cluster: ["opensearch"]
secured: ["true", "false"]
opensearch_version: [""]
entry:
- { opensearch_version: 1.0.0 }
- { opensearch_version: 1.0.1 }
- { opensearch_version: 1.1.0 }
- { opensearch_version: 1.2.0 }
- { opensearch_version: 1.2.1 }
- { opensearch_version: 1.2.2 }
- { opensearch_version: 1.2.3 }
- { opensearch_version: 1.2.4 }
- { opensearch_version: 1.3.0 }
- { opensearch_version: 1.3.1 }

steps:
- name: Checkout
if: ${{ matrix.opensearch_version != ''}}
uses: actions/checkout@v2

- name: Integ ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.opensearch_version}}
if: ${{ matrix.opensearch_version != ''}}
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.opensearch_version }}"
- name: Integ ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.entry.opensearch_version}}
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.entry.opensearch_version }}"
31 changes: 7 additions & 24 deletions test_opensearchpy/test_async/test_server/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,28 +872,11 @@ async def test_children_are_reindexed_correctly(
):
await helpers.async_reindex(async_client, "test-index", "real-index")

q = await async_client.get(index="real-index", id=42)
assert {
"_id": "42",
"_index": "real-index",
"_primary_term": 1,
"_seq_no": 0,
"_source": {"question_answer": "question"},
"_version": 1,
"found": True,
} == q

q = await async_client.get(index="test-index", id=47, routing=42)
assert {"question_answer": "question"} == (
await async_client.get(index="real-index", id=42)
)["_source"]

assert {
"_routing": "42",
"_id": "47",
"_index": "test-index",
"_primary_term": 1,
"_seq_no": 1,
"_source": {
"some": "data",
"question_answer": {"name": "answer", "parent": 42},
},
"_version": 1,
"found": True,
} == q
"some": "data",
"question_answer": {"name": "answer", "parent": 42},
} == (await async_client.get(index="test-index", id=47, routing=42))["_source"]
31 changes: 5 additions & 26 deletions test_opensearchpy/test_server/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,33 +738,12 @@ def setup_method(self, _):
def test_children_are_reindexed_correctly(self):
helpers.reindex(self.client, "test-index", "real-index")

q = self.client.get(index="real-index", id=42)
self.assertEqual(
{
"_id": "42",
"_index": "real-index",
"_primary_term": 1,
"_seq_no": 0,
"_source": {"question_answer": "question"},
"_version": 1,
"found": True,
},
q,
{"question_answer": "question"},
self.client.get(index="real-index", id=42)["_source"],
)
q = self.client.get(index="test-index", id=47, routing=42)

self.assertEqual(
{
"_routing": "42",
"_id": "47",
"_index": "test-index",
"_primary_term": 1,
"_seq_no": 1,
"_source": {
"some": "data",
"question_answer": {"name": "answer", "parent": 42},
},
"_version": 1,
"found": True,
},
q,
{"some": "data", "question_answer": {"name": "answer", "parent": 42}},
self.client.get(index="test-index", id=47, routing=42)["_source"],
)

0 comments on commit 3944cc2

Please sign in to comment.