Skip to content

Commit

Permalink
Added task tests with ID.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Dec 16, 2024
1 parent d9c0631 commit 4eb37b0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 16 deletions.
40 changes: 24 additions & 16 deletions tests/default/_core/tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
$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
Expand All @@ -13,23 +27,17 @@ chapters:
parameters:
group_by: parents
- synopsis: List tasks grouped by none.
id: task
path: /_tasks
method: GET
parameters:
group_by: none
output:
id: payload.tasks[0].id
node: payload.tasks[0].node
# - synopsis: Get task by id.
# id: task
# path: /_tasks/{task_id}
# method: GET
# parameters:
# task_id: ${task.node}:${task.id}
# response:
# status: 200
# payload:
# task:
# node: ${task.node}
# id: ${task.id}
- synopsis: Get task by id.
id: task
path: /_tasks/{task_id}
method: GET
parameters:
task_id: ${task.id}
response:
status: 200
payload:
completed: true
26 changes: 26 additions & 0 deletions tests/default/_core/tasks/cancel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +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

0 comments on commit 4eb37b0

Please sign in to comment.