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 2 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
7 changes: 2 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ jobs:
matrix:
cluster: ["opensearch"]
secured: ["true", "false"]
opensearch_version: [""]
opensearch_version: [1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0, 1.3.1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put these on a line each so we can diff easily when we add?


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 }}"
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.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"],
)