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 #154

Merged
Merged
Show file tree
Hide file tree
Changes from 7 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
18 changes: 10 additions & 8 deletions .github/workflows/test-integration-unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@ on:
branches:
- "main"

env:
OPENSEARCH_VERSION: '2.0'

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 11 ]
entry:
- { opensearch_ref: '1.x', java: 11 }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to test against 1.x branch as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

We may be releasing security patches, e.g. 1.3.2, so yes.

- { opensearch_ref: '2.x', java: 11 }
- { opensearch_ref: '2.x', java: 17 }
- { opensearch_ref: '2.0', java: 11 }
- { opensearch_ref: 'main', java: 11 }
steps:
- name: Set up JDK ${{ matrix.java }}
- name: Set up JDK ${{ matrix.entry.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
java-version: ${{ matrix.entry.java }}

- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: opensearch-project/opensearch
ref: ${{ env.OPENSEARCH_VERSION }}
repository: opensearch-project/OpenSearch
ref: ${{ matrix.entry.opensearch_ref }}
dblock marked this conversation as resolved.
Show resolved Hide resolved
path: opensearch

- name: Assemble OpenSearch
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,32 @@ jobs:
fail-fast: false
matrix:
entry:
- { opensearch_version: "", java: 11 }
- { opensearch_version: 1.0.0, java: 11 }
- { opensearch_version: 1.0.1, java: 11 }
- { opensearch_version: 1.1.0, java: 11 }
- { opensearch_version: 1.2.0, java: 11 }
- { opensearch_version: 1.2.1, java: 11 }
- { opensearch_version: 1.2.2, java: 11 }
- { opensearch_version: 1.2.3, java: 11 }
- { opensearch_version: 1.2.4, java: 11 }
- { opensearch_version: 1.3.0, java: 11 }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry I missed this earlier, you can also add 1.3.1 in here - on 1.x branch we have https://github.com/opensearch-project/opensearch-java/blob/1.x/.github/workflows/test-integration.yml.

Copy link
Member Author

Choose a reason for hiding this comment

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

steps:
- name: Set up JDK ${{ matrix.java }}
if: ${{ matrix.entry.opensearch_version != ''}}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.entry.java }}

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

- name: Run Docker
if: ${{ matrix.entry.opensearch_version != ''}}
run: |
docker-compose --project-directory .ci/opensearch build --build-arg OPENSEARCH_VERSION=${{ matrix.entry.opensearch_version }}
docker-compose --project-directory .ci/opensearch up -d
sleep 60
- name: Run Integration Test
if: ${{ matrix.entry.opensearch_version != ''}}
run: ./gradlew clean integrationTest

- name: Stop Docker
if: ${{ matrix.entry.opensearch_version != ''}}
run: |
docker-compose --project-directory .ci/opensearch down
8 changes: 7 additions & 1 deletion COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- [Compatibility with OpenSearch](#compatibility-with-opensearch)
- [Upgrading](#upgrading)

## Compatibility with OpenSearch

Expand All @@ -15,4 +16,9 @@ The below matrix shows the compatibility of the [`opensearch-java-client`](https
| 1.2.3 | 1.0.0 |
| 1.2.4 | 1.0.0 |
| 1.3.0 | 1.0.0 |
| 1.3.1 | 1.0.0 |
| 1.3.1 | 1.0.0 |
| 2.0.0 | 2.0.0 |

## Upgrading

Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-java-client` 2.0.0 works against OpenSearch 1.3.1, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information.
2 changes: 1 addition & 1 deletion config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,10 @@ public void testUpdate() throws Exception {
try {
highLevelClient().update(updateRequest, AppData.class);
} catch (OpenSearchException e) {
assertEquals(
"Request failed: [document_missing_exception] " +
"[does_not_exist]: document missing",
e.getMessage()
);
// 1.x: [document_missing_exception] [_doc][does_not_exist]: document missing
// 2.x: [document_missing_exception] [does_not_exist]: document missing
assertTrue(e.getMessage().contains("[document_missing_exception]"));
assertTrue(e.getMessage().contains("[does_not_exist]: document missing"));
assertEquals(404, e.status());
}
}
Expand Down