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 missing task tests. #746

Merged
merged 1 commit into from
Dec 18, 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
39 changes: 39 additions & 0 deletions tests/default/_core/tasks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test tasks endpoint.
prologues:
- path: /books/_delete_by_query
id: task
method: POST
parameters:
refresh: true
conflicts: proceed
wait_for_completion: false
request:
payload:
query:
match_all: {}
output:
id: payload.task
chapters:
- synopsis: List tasks grouped by node.
path: /_tasks
method: GET
parameters:
group_by: nodes
- synopsis: List tasks grouped by parent.
path: /_tasks
method: GET
parameters:
group_by: parents
- synopsis: List tasks grouped by none.
path: /_tasks
method: GET
parameters:
group_by: none
- synopsis: Get task by id.
id: task
path: /_tasks/{task_id}
method: GET
parameters:
task_id: ${task.id}
33 changes: 33 additions & 0 deletions tests/default/_core/tasks/cancel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test tasks endpoint.
prologues:
- path: /books/_delete_by_query
id: task
method: POST
parameters:
refresh: true
conflicts: proceed
wait_for_completion: false
request:
payload:
query:
match_all: {}
output:
id: payload.task
chapters:
- synopsis: Cancel all tasks.
path: /_tasks/_cancel
method: POST
- synopsis: Cancel a task.
path: /_tasks/{task_id}/_cancel
method: POST
parameters:
task_id: ${task.id}
response:
status: 200
payload:
node_failures:
- type: failed_node_exception
caused_by:
type: resource_not_found_exception
25 changes: 0 additions & 25 deletions tests/default/tasks/list.yaml

This file was deleted.

Loading