diff --git a/.github/opensearch-cluster/docker-compose.yml b/.github/opensearch-cluster/docker-compose.yml index 48a008634..e2ea4b2de 100644 --- a/.github/opensearch-cluster/docker-compose.yml +++ b/.github/opensearch-cluster/docker-compose.yml @@ -4,10 +4,10 @@ services: opensearch-cluster: image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}${OPENSEARCH_DOCKER_REF} ports: - - '9200:9200' - - '9600:9600' + - 9200:9200 + - 9600:9600 environment: - - 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}' + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!} - OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS} - discovery.type=single-node - path.repo=/tmp/opensearch/repo diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 86590741a..80f7577f8 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -23,12 +23,17 @@ jobs: strategy: matrix: entry: - - {version: 1.3.17, admin_password: admin} - - {version: 2.0.0, admin_password: admin} - - {version: 2.15.0} + - version: 1.3.17 + admin_password: admin + - version: 2.0.0 + admin_password: admin + - version: 2.15.0 - version: 2.16.0 hub: opensearchstaging - ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f' + ref: '@sha256:bcd7f5d5d30231f24f266064248cc8d3306574948190f7bf93016dff29acf17e' + - version: 3.0.0 + hub: opensearchstaging + ref: '@sha256:db1918b2b8f7ef6c22dd6ff54a0640877c3d395a392a53864745024933981e3b' name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }}) runs-on: ubuntu-latest @@ -56,6 +61,11 @@ jobs: working-directory: .github/opensearch-cluster run: docker compose up -d + - name: Get Container ID + id: container + run: | + echo "CONTAINER_ID=$(docker ps -aqf "ancestor=opensearchproject/opensearch:${{ matrix.entry.version }}")" >> $GITHUB_OUTPUT + - name: Run Tests run: | npm run test:spec -- \ @@ -63,6 +73,12 @@ jobs: --opensearch-version=${{ matrix.entry.version }} \ --coverage coverage/test-spec-coverage-${{ matrix.entry.version }}.json + - name: Get Container Logs + if: failure() && steps.container.outputs.CONTAINER_ID + run: | + echo Dumping logs from ${{ steps.container.outputs.CONTAINER_ID }} ... + docker logs ${{ steps.container.outputs.CONTAINER_ID }} + - name: Upload Test Coverage Results uses: actions/upload-artifact@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index e24e482b8..dadcbee4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added a warning on mulitple paths being tested in the same file ([#452](https://github.com/opensearch-project/opensearch-api-specification/pull/452)) - Added `/_plugins/_query/settings` ([#456](https://github.com/opensearch-project/opensearch-api-specification/pull/456)) - Added `/_plugins/_ppl`, `explain` and `stats` ([#460](https://github.com/opensearch-project/opensearch-api-specification/pull/460)) +- Added tests against OpenSearch 3.0 ([#459](https://github.com/opensearch-project/opensearch-api-specification/pull/459)) ### Changed diff --git a/spec/schemas/nodes._common.yaml b/spec/schemas/nodes._common.yaml index ee172b93e..59378e88a 100644 --- a/spec/schemas/nodes._common.yaml +++ b/spec/schemas/nodes._common.yaml @@ -1092,6 +1092,9 @@ components: $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerStats' cancellation_stats: $ref: '#/components/schemas/ShardSearchBackpressureTaskCancellationStats' + completion_count: + x-version-added: '3.0' + type: number ShardSearchBackpressureTaskResourceTrackerStats: type: object properties: diff --git a/tests/ingest/pipeline.yaml b/tests/ingest/pipeline.yaml index c10c4f327..ee8e539ea 100644 --- a/tests/ingest/pipeline.yaml +++ b/tests/ingest/pipeline.yaml @@ -6,7 +6,7 @@ epilogues: - path: /_ingest/pipeline/books_pipeline method: DELETE status: [200, 404] -version: '>= 2.11' +version: '>= 2.11, < 3.0' # TODO: re-enable using a 3.0 build with the neural-search plugin chapters: - synopsis: Create ingest pipeline for text embedding. path: /_ingest/pipeline/{id} diff --git a/tests/sql/close.yaml b/tests/sql/close.yaml index 8df8a4c01..df2910ae9 100644 --- a/tests/sql/close.yaml +++ b/tests/sql/close.yaml @@ -22,7 +22,13 @@ prologues: method: POST parameters: index: books - - id: query_sql + - path: _plugins/_query/settings + method: PUT + request_body: + payload: + transient: + plugins.query.memory_limit: 100% + - id: sql_query path: /_plugins/_sql method: POST request_body: @@ -41,6 +47,6 @@ chapters: method: POST request_body: payload: - cursor: ${query_sql.cursor} + cursor: ${sql_query.cursor} response: - status: 200 \ No newline at end of file + status: 200 diff --git a/tests/sql/explain.yaml b/tests/sql/explain.yaml index 16ea254f8..3679dcb29 100644 --- a/tests/sql/explain.yaml +++ b/tests/sql/explain.yaml @@ -7,6 +7,12 @@ prologues: method: PUT request_body: payload: {} + - path: _plugins/_query/settings + method: PUT + request_body: + payload: + transient: + plugins.query.memory_limit: 100% epilogues: - path: /books method: DELETE diff --git a/tests/sql/query.yaml b/tests/sql/query.yaml index 3111d0d64..e66942606 100644 --- a/tests/sql/query.yaml +++ b/tests/sql/query.yaml @@ -9,6 +9,12 @@ prologues: index: books request_body: payload: {} + - path: _plugins/_query/settings + method: PUT + request_body: + payload: + transient: + plugins.query.memory_limit: 100% epilogues: - path: /books method: DELETE