Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable integration tests across multiple versions of OpenSearch #163

Merged
merged 3 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"],
)