Skip to content

Commit

Permalink
Extracted ML tests into a separate workflow execution. (#533)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 27, 2024
1 parent 3a9caa7 commit 80463b1
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions tests/default/_core/reindex/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions tests/default/asynchronous_search/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions tests/default/asynchronous_search/stats.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 2 additions & 8 deletions tests/default/indices/component_template.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -84,26 +84,20 @@ chapters:
response:
status: 200
- synopsis: Create an index using the composite template.
warnings:
multiple-paths-detected: false
path: /{index}
method: PUT
parameters:
index: logs-2020-01-01
response:
status: 200
- synopsis: Get an index using the composite template.
warnings:
multiple-paths-detected: false
path: /{index}
method: GET
parameters:
index: logs-2020-01-01
response:
status: 200
- synopsis: Delete index template.
warnings:
multiple-paths-detected: false
path: /_index_template/{name}
method: DELETE
parameters:
Expand Down
13 changes: 13 additions & 0 deletions tests/plugins/ml/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
$schema: ../../../json_schemas/test_story.schema.yaml
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test the creation of model groups.
distributions:
excluded:
- 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
Expand Down
15 changes: 3 additions & 12 deletions tests/default/ml/models.yaml → tests/plugins/ml/ml/models.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
$schema: ../../../json_schemas/test_story.schema.yaml
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test the creation of models.
distributions:
excluded:
- 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
Expand All @@ -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:
Expand Down
8 changes: 2 additions & 6 deletions tools/tests/tester/fixtures/stories/passed.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 80463b1

Please sign in to comment.