diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index c3220b9f4..a9b0963b9 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -30,6 +30,8 @@ jobs: - version: 2.16.0 - version: 2.16.0 tests: plugins/index_state_management + - version: 2.16.0 + tests: plugins/ml - version: 2.16.0 tests: snapshot - version: 2.17.0 diff --git a/TESTING_GUIDE.md b/TESTING_GUIDE.md index 852d3844b..98dae41ab 100644 --- a/TESTING_GUIDE.md +++ b/TESTING_GUIDE.md @@ -168,7 +168,7 @@ chapters: ### Using Output from Previous Chapters -Consider the following chapters in [ml/model_groups](tests/default/ml/model_groups.yaml) test story: +Consider the following chapters in [ml/model_groups](tests/plugins/ml/ml/model_groups.yaml) test story: ```yaml - synopsis: Create model group. id: create_model_group # Only needed if you want to refer to this chapter in another chapter. diff --git a/tests/default/_core/reindex/pipeline.yaml b/tests/default/_core/reindex/pipeline.yaml index bd63c249d..30a2fd6ac 100644 --- a/tests/default/_core/reindex/pipeline.yaml +++ b/tests/default/_core/reindex/pipeline.yaml @@ -1,6 +1,8 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test reindex with a Search pipeline. +warnings: + multiple-paths-detected: false epilogues: - path: /movies method: DELETE @@ -54,15 +56,11 @@ chapters: response: status: 200 - synopsis: Refresh the index. - warnings: - multiple-paths-detected: false path: /{index}/_refresh method: POST parameters: index: videos - synopsis: Get all videos. - warnings: - multiple-paths-detected: false path: /{index}/_search method: POST parameters: diff --git a/tests/default/asynchronous_search/search.yaml b/tests/default/asynchronous_search/search.yaml index 1280369bf..23e22d57c 100644 --- a/tests/default/asynchronous_search/search.yaml +++ b/tests/default/asynchronous_search/search.yaml @@ -57,9 +57,3 @@ chapters: id: ${async_search.id} response: status: 200 - - synopsis: Get stats. - path: /_plugins/_asynchronous_search/stats - method: GET - version: < 3.0 - response: - status: 200 \ No newline at end of file diff --git a/tests/default/asynchronous_search/stats.yaml b/tests/default/asynchronous_search/stats.yaml new file mode 100644 index 000000000..7854b156e --- /dev/null +++ b/tests/default/asynchronous_search/stats.yaml @@ -0,0 +1,11 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test asynchronous_search. + +chapters: + - synopsis: Get stats. + path: /_plugins/_asynchronous_search/stats + method: GET + version: < 3.0 + response: + status: 200 diff --git a/tests/default/indices/component_template.yaml b/tests/default/indices/component_template.yaml index ff7b2d39f..389db0e3c 100644 --- a/tests/default/indices/component_template.yaml +++ b/tests/default/indices/component_template.yaml @@ -1,6 +1,8 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test component templates. +warnings: + multiple-paths-detected: false epilogues: - path: /logs-2020-01-01 method: DELETE @@ -51,8 +53,6 @@ chapters: response: status: 200 - synopsis: Create an index template composed of 2 component templates. - warnings: - multiple-paths-detected: false path: /_index_template/{name} method: POST parameters: @@ -84,8 +84,6 @@ chapters: response: status: 200 - synopsis: Create an index using the composite template. - warnings: - multiple-paths-detected: false path: /{index} method: PUT parameters: @@ -93,8 +91,6 @@ chapters: response: status: 200 - synopsis: Get an index using the composite template. - warnings: - multiple-paths-detected: false path: /{index} method: GET parameters: @@ -102,8 +98,6 @@ chapters: response: status: 200 - synopsis: Delete index template. - warnings: - multiple-paths-detected: false path: /_index_template/{name} method: DELETE parameters: diff --git a/tests/plugins/ml/docker-compose.yml b/tests/plugins/ml/docker-compose.yml new file mode 100644 index 000000000..3aa6de878 --- /dev/null +++ b/tests/plugins/ml/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + opensearch-cluster: + image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}${OPENSEARCH_DOCKER_REF} + ports: + - 9200:9200 + - 9600:9600 + environment: + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!} + - OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS} + - discovery.type=single-node + - plugins.ml_commons.only_run_on_ml_node=false diff --git a/tests/default/ingest/pipeline/neural_search.yaml b/tests/plugins/ml/ingest/pipeline/neural_search.yaml similarity index 95% rename from tests/default/ingest/pipeline/neural_search.yaml rename to tests/plugins/ml/ingest/pipeline/neural_search.yaml index e99d10f23..ca2fdd60a 100644 --- a/tests/default/ingest/pipeline/neural_search.yaml +++ b/tests/plugins/ml/ingest/pipeline/neural_search.yaml @@ -1,4 +1,4 @@ -$schema: ../../../../json_schemas/test_story.schema.yaml +$schema: ../../../../../json_schemas/test_story.schema.yaml description: Test the creation a neural search ingest pipeline. distributions: @@ -8,15 +8,6 @@ distributions: - amazon-serverless warnings: multiple-paths-detected: false -prologues: - - path: /_cluster/settings - method: PUT - request: - payload: - persistent: - plugins: - ml_commons: - only_run_on_ml_node: false epilogues: - path: /_ingest/pipeline/movies_pipeline method: DELETE diff --git a/tests/default/ml/model_groups.yaml b/tests/plugins/ml/ml/model_groups.yaml similarity index 82% rename from tests/default/ml/model_groups.yaml rename to tests/plugins/ml/ml/model_groups.yaml index 33ad68cbe..e6e1a669a 100644 --- a/tests/default/ml/model_groups.yaml +++ b/tests/plugins/ml/ml/model_groups.yaml @@ -1,4 +1,4 @@ -$schema: ../../../json_schemas/test_story.schema.yaml +$schema: ../../../../json_schemas/test_story.schema.yaml description: Test the creation of model groups. distributions: @@ -6,15 +6,6 @@ distributions: - amazon-managed - amazon-serverless version: '>= 2.11' -prologues: - - path: /_cluster/settings - method: PUT - request: - payload: - persistent: - plugins: - ml_commons: - only_run_on_ml_node: false epilogues: - path: /_plugins/_ml/model_groups/{model_group_id} method: DELETE diff --git a/tests/default/ml/models.yaml b/tests/plugins/ml/ml/models.yaml similarity index 77% rename from tests/default/ml/models.yaml rename to tests/plugins/ml/ml/models.yaml index 2e0a94524..ce087654f 100644 --- a/tests/default/ml/models.yaml +++ b/tests/plugins/ml/ml/models.yaml @@ -1,4 +1,4 @@ -$schema: ../../../json_schemas/test_story.schema.yaml +$schema: ../../../../json_schemas/test_story.schema.yaml description: Test the creation of models. distributions: @@ -6,15 +6,8 @@ distributions: - amazon-managed - amazon-serverless version: '>= 2.11' -prologues: - - path: /_cluster/settings - method: PUT - request: - payload: - persistent: - plugins: - ml_commons: - only_run_on_ml_node: false +warnings: + multiple-paths-detected: false chapters: - synopsis: Register model. id: register_model @@ -33,8 +26,6 @@ chapters: id: get_completed_task path: /_plugins/_ml/tasks/{task_id} method: GET - warnings: - multiple-paths-detected: false parameters: task_id: ${register_model.task_id} response: diff --git a/tools/tests/tester/fixtures/stories/passed.yaml b/tools/tests/tester/fixtures/stories/passed.yaml index a882666b3..7c51b9dc0 100644 --- a/tools/tests/tester/fixtures/stories/passed.yaml +++ b/tools/tests/tester/fixtures/stories/passed.yaml @@ -1,6 +1,8 @@ $schema: ../../../../../json_schemas/test_story.schema.yaml description: This story should pass. +warnings: + multiple-paths-detected: false epilogues: - path: /books method: DELETE @@ -9,23 +11,17 @@ chapters: - synopsis: This PUT /{index} chapter should pass. path: /{index} method: PUT - warnings: - multiple-paths-detected: false parameters: index: books - synopsis: This GET /_cat chapter returns text/plain and should pass. path: /_cat method: GET - warnings: - multiple-paths-detected: false response: status: 200 content_type: text/plain - synopsis: This GET /_cat chapter with a header should pass. path: /_cat method: GET - warnings: - multiple-paths-detected: false request: headers: User-Agent: OpenSearch API Spec/1.0