From 9c16403b9228d3354dc12d735966c8450461c5e3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 11:39:37 -0700 Subject: [PATCH] Add support to test against multiple versions of OpenSearch (#228) (#237) * Expand test matrix to include multiple versions of OpenSearch Signed-off-by: Vacha Shah * Add a compatibility matrix Signed-off-by: Vacha Shah * Updating the github workflow matrix Signed-off-by: Vacha Shah (cherry picked from commit f62a8cd644e6c5c65ea66932fc4b22ea76a57a67) Co-authored-by: Vacha Shah --- .ci/opensearch/Dockerfile.opensearch | 2 +- .github/workflows/compatibility.yml | 59 ++++++++++++++++++++++++++++ COMPATIBILITY.md | 18 +++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/compatibility.yml create mode 100644 COMPATIBILITY.md diff --git a/.ci/opensearch/Dockerfile.opensearch b/.ci/opensearch/Dockerfile.opensearch index 161508e76..67a1a3b13 100644 --- a/.ci/opensearch/Dockerfile.opensearch +++ b/.ci/opensearch/Dockerfile.opensearch @@ -1,5 +1,5 @@ ARG OPENSEARCH_VERSION -FROM opensearchproject/opensearch:$OPENSEARCH_VERSION +FROM opensearchproject/opensearch:${OPENSEARCH_VERSION} ARG opensearch_path=/usr/share/opensearch ARG opensearch_yml=$opensearch_path/config/opensearch.yml diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml new file mode 100644 index 000000000..d476bb652 --- /dev/null +++ b/.github/workflows/compatibility.yml @@ -0,0 +1,59 @@ +name: Integration for Compatibility + +on: [push, pull_request] + +jobs: + integration-test-compatibility: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + secured: ["true", "false"] + entry: + - { 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: + - uses: actions/checkout@v2 + + - name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + + - name: Runs OpenSearch cluster + run: | + export OPENSEARCH_VERSION=${{ matrix.entry.opensearch_version }} + export SECURE_INTEGRATION=${{ matrix.secured }} + make cluster.clean cluster.opensearch.build cluster.opensearch.start + + - name: Use Node.js 16.x + uses: actions/setup-node@v1 + with: + node-version: 16.x + + - name: Install + run: | + npm install + + - name: Integration test without security + if: ${{ matrix.secured == 'false'}} + run: | + npm run test:integration:helpers + + - name: Integration test with security + if: ${{ matrix.secured == 'true'}} + run: | + npm run test:integration:helpers-secure + + - name: Stop the OpenSearch cluster + run: | + make cluster.opensearch.stop \ No newline at end of file diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md new file mode 100644 index 000000000..de8e8f582 --- /dev/null +++ b/COMPATIBILITY.md @@ -0,0 +1,18 @@ +- [Compatibility with OpenSearch](#compatibility-with-opensearch) + +## Compatibility with OpenSearch + +The below matrix shows the compatibility of the [`opensearch-js`](https://www.npmjs.com/package/@opensearch-project/opensearch) with versions of [`OpenSearch`](https://opensearch.org/downloads.html#opensearch). + +| OpenSearch Version | Client Version | +| --- | --- | +| 1.0.0 | 1.0.0 | +| 1.0.1 | 1.0.0 | +| 1.1.0 | 1.1.0 | +| 1.2.0 | 1.1.0 | +| 1.2.1 | 1.1.0 | +| 1.2.2 | 1.1.0 | +| 1.2.3 | 1.1.0 | +| 1.2.4 | 1.1.0 | +| 1.3.0 | 1.1.0 | +| 1.3.1 | 1.1.0 |