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

Added tests for component_template. #414

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
87 changes: 87 additions & 0 deletions tests/cluster/component_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test component templates.
epilogues:
- path: /_component_template/template1
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create a component template.
path: /_component_template/{name}
method: POST
parameters:
name: template1
request_body:
payload:
template:
settings:
number_of_shards: 1
mappings:
_source:
enabled: false
properties:
name:
type: keyword
age:
type: integer
response:
status: 200
- synopsis: Update a component template.
path: /_component_template/{name}
method: PUT
parameters:
name: template1
request_body:
payload:
template:
settings:
number_of_shards: 2
mappings:
_source:
enabled: false
properties:
name:
type: keyword
age:
type: integer
aliases:
alias1: {}
response:
status: 200
- synopsis: Check if the component template exists.
path: /_component_template/{name}
method: HEAD
parameters:
name: template1
cluster_manager_timeout: 10s
local: false
response:
status: 200
- synopsis: Get all component templates.
path: /_component_template
method: GET
parameters:
cluster_manager_timeout: 10s
local: false
response:
status: 200
- synopsis: Get a component template.
path: /_component_template/{name}
method: GET
parameters:
name: template1
response:
status: 200
payload:
component_templates:
- name: template1
component_template:
template:
settings:
index:
number_of_shards: '2'
- synopsis: Delete the component template.
path: /_component_template/{name}
method: DELETE
parameters:
name: template1
22 changes: 10 additions & 12 deletions tests/indices/data_stream.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test data streams.
epilogues:
- path: /_data_stream/logs-nginx
method: DELETE
status: [200, 404]
- path: /_index_template/logs-template
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create an index template.
path: /_index_template/{name}
prologues:
- path: /_index_template/logs-template-nginx
method: PUT
parameters:
name: logs-template-nginx
request_body:
payload:
index_patterns:
Expand All @@ -23,6 +13,14 @@ chapters:
timestamp_field:
name: request_time
priority: 100
epilogues:
- path: /_data_stream/logs-nginx
method: DELETE
status: [200, 404]
- path: /_index_template/logs-template
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create a data stream.
path: /_data_stream/{name}
method: PUT
Expand Down
2 changes: 2 additions & 0 deletions tests/indices/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ chapters:
method: HEAD
parameters:
index: movies
cluster_manager_timeout: 10s
response:
status: 404

Expand Down Expand Up @@ -78,3 +79,4 @@ chapters:
method: DELETE
parameters:
index: books,games
cluster_manager_timeout: 10s
1 change: 1 addition & 0 deletions tests/indices/index_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ chapters:
method: HEAD
parameters:
name: daily_logs
cluster_manager_timeout: 10s
response:
status: 200
- synopsis: Delete an index template.
Expand Down
Loading