-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support combining multiple output variables.
Signed-off-by: dblock <[email protected]>
- Loading branch information
Showing
9 changed files
with
100 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 17 additions & 7 deletions
24
tests/default/tasks/list.yaml → tests/default/_core/tasks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test tasks list endpoint. | ||
description: Test tasks endpoint. | ||
chapters: | ||
- synopsis: List tasks grouped by node. | ||
path: /_tasks | ||
method: GET | ||
parameters: | ||
group_by: nodes | ||
response: | ||
status: 200 | ||
- synopsis: List tasks grouped by parent. | ||
path: /_tasks | ||
method: GET | ||
parameters: | ||
group_by: parents | ||
response: | ||
status: 200 | ||
- synopsis: List tasks grouped by none. | ||
id: task | ||
path: /_tasks | ||
method: GET | ||
parameters: | ||
group_by: none | ||
response: | ||
status: 200 | ||
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test tasks endpoint. | ||
chapters: | ||
- synopsis: Cancel all tasks. | ||
path: /_tasks/_cancel | ||
method: POST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
import { OutputReference } from "tester/types/eval.types"; | ||
|
||
describe('OutputReference', () => { | ||
let f = (id: any, k: any): string => `[${id}:${k}]` | ||
|
||
describe('replace', () => { | ||
it('replaces', () => { | ||
expect(OutputReference.replace('string', f)).toEqual('string') | ||
expect(OutputReference.replace('${k.v}', f)).toEqual('[k:v]') | ||
expect(OutputReference.replace('${k.value}', f)).toEqual('[k:value]') | ||
expect(OutputReference.replace('${k.v.m}', f)).toEqual('[k:v.m]') | ||
}) | ||
}) | ||
}); |