From af30013bf8ef1abc5cf7a7810e0eac7b4646bda7 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 22:56:02 +0500 Subject: [PATCH 01/16] adding missing tests Signed-off-by: Tokesh --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 16 ++++++++++++ tests/default/_core/search/scroll.yaml | 8 ++++++ tests/default/_core/update_by_query.yaml | 25 +++++++++++++++++++ .../workload-management/wlm/query_group.yaml | 22 ++++++++++++++-- tests/snapshot/snapshot/restore.yaml | 4 ++- 6 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 tests/default/_core/update_by_query.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c0eb3df..6143190f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,6 +191,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) +- Added 404 response to `/_search/scroll` ([#x](https://github.com/opensearch-project/opensearch-api-specification/pull/x)) ### Changed diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 63a36d3d9..846ad5932 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -898,6 +898,8 @@ paths: responses: '200': $ref: '#/components/responses/clear_scroll@200' + '404': + $ref: '#/components/responses/clear_scroll@404' /_search/scroll/{scroll_id}: get: operationId: scroll.2 @@ -2868,6 +2870,20 @@ components: required: - num_freed - succeeded + clear_scroll@404: + content: + application/json: + schema: + type: object + properties: + succeeded: + type: boolean + num_freed: + type: integer + format: int32 + required: + - num_freed + - succeeded count@200: content: application/json: diff --git a/tests/default/_core/search/scroll.yaml b/tests/default/_core/search/scroll.yaml index fb4baccd1..6ed9e10ff 100644 --- a/tests/default/_core/search/scroll.yaml +++ b/tests/default/_core/search/scroll.yaml @@ -105,3 +105,11 @@ chapters: path: /_search/scroll/{scroll_id} parameters: scroll_id: ${scroll.scroll_id} + - synopsis: Deleting a non-existent scroll. + method: DELETE + path: /_search/scroll + request: + payload: + scroll_id: ${scroll.scroll_id} + response: + status: 404 diff --git a/tests/default/_core/update_by_query.yaml b/tests/default/_core/update_by_query.yaml new file mode 100644 index 000000000..40a1ad72e --- /dev/null +++ b/tests/default/_core/update_by_query.yaml @@ -0,0 +1,25 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test Update By Query 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: Update by query. + path: /_update_by_query/{task_id}/_rethrottle + method: POST + parameters: + task_id: ${task.id} + requests_per_second: 10 + diff --git a/tests/plugins/workload-management/wlm/query_group.yaml b/tests/plugins/workload-management/wlm/query_group.yaml index aa6a68b9d..da286e8df 100644 --- a/tests/plugins/workload-management/wlm/query_group.yaml +++ b/tests/plugins/workload-management/wlm/query_group.yaml @@ -13,6 +13,16 @@ chapters: resource_limits: memory: 0.1 resiliency_mode: monitor + - synopsis: Update a QueryGroup by name. + path: /_wlm/query_group/{name} + method: PUT + parameters: + name: analytics + request: + payload: + resource_limits: + memory: 0.2 + resiliency_mode: restrict - synopsis: Get the QueryGroup by name. path: /_wlm/query_group/{name} method: GET @@ -24,11 +34,19 @@ chapters: query_groups: - name: analytics resource_limits: - memory: 0.1 - resiliency_mode: monitor + memory: 0.2 + resiliency_mode: restrict - synopsis: Get all QueryGroups. path: /_wlm/query_group method: GET + response: + status: 200 + payload: + query_groups: + - name: analytics + resource_limits: + memory: 0.2 + resiliency_mode: restrict - synopsis: Delete a QueryGroup. path: /_wlm/query_group/{name} parameters: diff --git a/tests/snapshot/snapshot/restore.yaml b/tests/snapshot/snapshot/restore.yaml index d2eaad807..29c1d799b 100644 --- a/tests/snapshot/snapshot/restore.yaml +++ b/tests/snapshot/snapshot/restore.yaml @@ -50,7 +50,9 @@ prologues: index: stories alias: stories_alias - path: /_snapshot/{repository}/{snapshot} - method: PUT + method: + - POST + - PUT parameters: repository: my-fs-repository snapshot: my-test-snapshot From fa6891e77b0b909ef80b20d31780b60943927e82 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:03:39 +0500 Subject: [PATCH 02/16] fixing validate ci, links, added node failure in specs Signed-off-by: Tokesh --- CHANGELOG.md | 2 +- spec/namespaces/_core.yaml | 6 ++++++ tests/plugins/workload-management/wlm/query_group.yaml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6143190f7..a297406be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,7 +191,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) -- Added 404 response to `/_search/scroll` ([#x](https://github.com/opensearch-project/opensearch-api-specification/pull/x)) +- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) ### Changed diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 846ad5932..cd7d1b614 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -958,6 +958,8 @@ paths: responses: '200': $ref: '#/components/responses/clear_scroll@200' + '404': + $ref: '#/components/responses/clear_scroll@404' /_search/template: get: operationId: search_template.0 @@ -3386,6 +3388,10 @@ components: type: object additionalProperties: $ref: '../schemas/_core.update_by_query_rethrottle.yaml#/components/schemas/UpdateByQueryRethrottleNode' + node_failures: + type: array + items: + $ref: '_common.yaml#/components/schemas/ErrorCause' required: - nodes parameters: diff --git a/tests/plugins/workload-management/wlm/query_group.yaml b/tests/plugins/workload-management/wlm/query_group.yaml index da286e8df..b8a060755 100644 --- a/tests/plugins/workload-management/wlm/query_group.yaml +++ b/tests/plugins/workload-management/wlm/query_group.yaml @@ -22,7 +22,7 @@ chapters: payload: resource_limits: memory: 0.2 - resiliency_mode: restrict + resiliency_mode: soft - synopsis: Get the QueryGroup by name. path: /_wlm/query_group/{name} method: GET @@ -35,7 +35,7 @@ chapters: - name: analytics resource_limits: memory: 0.2 - resiliency_mode: restrict + resiliency_mode: soft - synopsis: Get all QueryGroups. path: /_wlm/query_group method: GET From 64fc829feb15ab034dee8b7244a33762b07827eb Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:12:16 +0500 Subject: [PATCH 03/16] adding node failures to changelog, fixing path in specs of update by query and small fix in response of query group tests Signed-off-by: Tokesh --- CHANGELOG.md | 4 +++- spec/namespaces/_core.yaml | 2 +- tests/plugins/workload-management/wlm/query_group.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a297406be..94d891a4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `_type` to `termvector` and `mtermvector` ([#734](https://github.com/opensearch-project/opensearch-api-specification/pull/734)) - Added missing `cancelled` and `resource_stats` to `/_reindex/{task_id}/_rethrottle` ([#740](https://github.com/opensearch-project/opensearch-api-specification/pull/740)) - Added missing `cancellation_time_millis` to `POST /_tasks/_cancel` ([#747](https://github.com/opensearch-project/opensearch-api-specification/pull/747)) +- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) +- Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) @@ -191,7 +193,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) -- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) + ### Changed diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index cd7d1b614..e97de368d 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -3391,7 +3391,7 @@ components: node_failures: type: array items: - $ref: '_common.yaml#/components/schemas/ErrorCause' + $ref: '../schemas/_common.yaml#/components/schemas/ErrorCause' required: - nodes parameters: diff --git a/tests/plugins/workload-management/wlm/query_group.yaml b/tests/plugins/workload-management/wlm/query_group.yaml index b8a060755..475d5ef8a 100644 --- a/tests/plugins/workload-management/wlm/query_group.yaml +++ b/tests/plugins/workload-management/wlm/query_group.yaml @@ -46,7 +46,7 @@ chapters: - name: analytics resource_limits: memory: 0.2 - resiliency_mode: restrict + resiliency_mode: soft - synopsis: Delete a QueryGroup. path: /_wlm/query_group/{name} parameters: From e19dc250654887bc34642795c39317bbddffb705 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 18 Dec 2024 12:29:10 -0500 Subject: [PATCH 04/16] Support combining multiple output variables. (#737) * Support combining multiple output variables. Signed-off-by: dblock Signed-off-by: Tokesh --- .lycheeignore | 1 + CHANGELOG.md | 1 + TESTING_GUIDE.md | 4 +- tests/plugins/ml/ml/connectors.yaml | 6 +-- tools/src/helpers.ts | 18 +++++++ tools/src/tester/OutputReference.ts | 57 ++++++++++++++++++++++ tools/src/tester/StoryEvaluator.ts | 13 ++--- tools/src/tester/StoryOutputs.ts | 11 ++--- tools/src/tester/types/eval.types.ts | 17 ------- tools/tests/helpers.test.ts | 25 +++++++++- tools/tests/tester/OutputReference.test.ts | 39 +++++++++++++++ tools/tests/tester/StoryOutputs.test.ts | 14 +++++- 12 files changed, 166 insertions(+), 40 deletions(-) create mode 100644 tools/src/tester/OutputReference.ts create mode 100644 tools/tests/tester/OutputReference.test.ts diff --git a/.lycheeignore b/.lycheeignore index 1b6a61169..4c14ce320 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -1,3 +1,4 @@ https://localhost:* http://localhost:* http://webhook:8080 +https://api.openai.com/v1/chat/completions diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d891a4b..213de17b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `_type` to `termvector` and `mtermvector` ([#734](https://github.com/opensearch-project/opensearch-api-specification/pull/734)) - Added missing `cancelled` and `resource_stats` to `/_reindex/{task_id}/_rethrottle` ([#740](https://github.com/opensearch-project/opensearch-api-specification/pull/740)) - Added missing `cancellation_time_millis` to `POST /_tasks/_cancel` ([#747](https://github.com/opensearch-project/opensearch-api-specification/pull/747)) +- Added support for combining output variables ([#737](https://github.com/opensearch-project/opensearch-api-specification/pull/737)) - Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) - Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749)) diff --git a/TESTING_GUIDE.md b/TESTING_GUIDE.md index 2812b37b2..c4590bd0a 100644 --- a/TESTING_GUIDE.md +++ b/TESTING_GUIDE.md @@ -244,7 +244,9 @@ Consider the following chapters in [ml/model_groups](tests/plugins/ml/ml/model_g ``` As you can see, the `output` field in the first chapter saves the `model_group_id` from the response body. This value is then used in the subsequent chapters to query and delete the model group. -You can also supply defaults for output values, e.g. for `payload._version` used in [cluster/routing/awareness/weights.yaml](tests/routing/cluster/routing/awareness/weights.yaml). +You can combine multiple values, e.g. `task_id: ${task.node}:${task.id}`. + +You can supply defaults for output values, e.g. for `payload._version` used in [cluster/routing/awareness/weights.yaml](tests/routing/cluster/routing/awareness/weights.yaml). ``` version: diff --git a/tests/plugins/ml/ml/connectors.yaml b/tests/plugins/ml/ml/connectors.yaml index 201019c04..c19939634 100644 --- a/tests/plugins/ml/ml/connectors.yaml +++ b/tests/plugins/ml/ml/connectors.yaml @@ -33,10 +33,10 @@ chapters: actions: - action_type: predict method: POST - url: 'https://${parameters.endpoint}/v1/chat/completions' + url: https://api.openai.com/v1/chat/completions headers: - Authorization: 'Bearer ${credential.openAI_key}' - request_body: '{ "model": "${parameters.model}", "messages": ${parameters.messages} }' + Authorization: Bearer Key + request_body: '{ "model": "model", "messages": "messages" }' response: status: 200 output: diff --git a/tools/src/helpers.ts b/tools/src/helpers.ts index 4144afd31..d338f7960 100644 --- a/tools/src/helpers.ts +++ b/tools/src/helpers.ts @@ -160,3 +160,21 @@ export function write_json (file_path: string, content: any, replacer?: (this: a export async function sleep (ms: number): Promise { await new Promise((resolve) => setTimeout(resolve, ms)) } + +/** + * Returns a string split using a delimiter, but only up to a certain number of times, + * returning the remainder of the string as the last element if the result. + * + * @param str a string + * @param delim delimiter + * @param count max number of splits + * @returns an array of strings + */ +export function split(str: any, delim: string, count: number = 0): string[] { + if (str === undefined) return [] + const parts = str.split(delim) + if (count <= 0 || parts.length <= count) return parts + const result = parts.slice(0, count - 1) + result.push(parts.slice(count - 1).join(delim)) + return result +} diff --git a/tools/src/tester/OutputReference.ts b/tools/src/tester/OutputReference.ts new file mode 100644 index 000000000..a76fb6249 --- /dev/null +++ b/tools/src/tester/OutputReference.ts @@ -0,0 +1,57 @@ +/* +* 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 { split } from "../helpers" + +export class OutputReference { + chapter_id: string + output_name: string + + constructor(chapter_id: string, output_name: string) { + this.chapter_id = chapter_id + this.output_name = output_name + } + + /** + * Parses a string and returns a collection of output references that it may contain. + * + * @param str a string + * @returns an array of output references + */ + static parse(str: string): OutputReference[] { + const pattern = /\$\{([^}]+)\}/g + let match + var result = [] + while ((match = pattern.exec(str)) !== null) { + const spl = split(match[1], '.', 2) + result.push(new OutputReference(spl[0], spl[1])) + } + return result + } + + /** + * Replaces occurrences of output references. + * Takes special care of preserving the type of the reference value if the entire string is a reference. + * + * @param str a string that may contain output references + * @param callback a callback for fetching reference values + * @returns a string with output references replaced by their values + */ + static replace(str: string, callback: (chapter_id: any, variable: any) => string): any { + let full_match = str.match(/^\$\{([^}]+)\}$/) + if (full_match) { + // the entire string is a reference, preserve the type of the returned value + const spl = split(full_match[1], '.', 2) + return callback(spl[0], spl[1]) + } else return str.replace(/\$\{([^}]+)\}/g, (_, k) => { + const spl = split(k, '.', 2) + return callback(spl[0], spl[1]) + }) + } +} diff --git a/tools/src/tester/StoryEvaluator.ts b/tools/src/tester/StoryEvaluator.ts index a17df942f..eb0bbf2f7 100644 --- a/tools/src/tester/StoryEvaluator.ts +++ b/tools/src/tester/StoryEvaluator.ts @@ -8,7 +8,7 @@ */ import { ChapterRequest, Parameter, SupplementalChapter } from './types/story.types' -import { type StoryFile, type ChapterEvaluation, Result, type StoryEvaluation, OutputReference } from './types/eval.types' +import { type StoryFile, type ChapterEvaluation, Result, type StoryEvaluation } from './types/eval.types' import type ChapterEvaluator from './ChapterEvaluator' import { overall_result } from './helpers' import { StoryOutputs } from './StoryOutputs' @@ -17,6 +17,7 @@ import { ChapterOutput } from './ChapterOutput' import * as semver from '../_utils/semver' import _ from 'lodash' import { ParsedChapter, ParsedStory } from './types/parsed_story.types' +import { OutputReference } from './OutputReference' export default class StoryEvaluator { private readonly _chapter_evaluator: ChapterEvaluator @@ -217,10 +218,7 @@ export default class StoryEvaluator { static #extract_params_variables(parameters: Record, variables: Set): void { Object.values(parameters ?? {}).forEach((param) => { if (typeof param === 'string') { - const ref = OutputReference.parse(param) - if (ref) { - variables.add(ref) - } + OutputReference.parse(param).forEach((ref) => variables.add(ref)) } }) } @@ -229,10 +227,7 @@ export default class StoryEvaluator { const request_type = typeof request switch (request_type) { case 'string': { - const ref = OutputReference.parse(request as string) - if (ref !== undefined) { - variables.add(ref) - } + OutputReference.parse(request as string).forEach((ref) => variables.add(ref)) break } case 'object': { diff --git a/tools/src/tester/StoryOutputs.ts b/tools/src/tester/StoryOutputs.ts index 41b8d9e71..b535bc62e 100644 --- a/tools/src/tester/StoryOutputs.ts +++ b/tools/src/tester/StoryOutputs.ts @@ -8,7 +8,7 @@ */ import { ChapterOutput } from './ChapterOutput' -import { OutputReference } from './types/eval.types' +import { OutputReference } from './OutputReference' import { type Parameter } from './types/story.types' export class StoryOutputs { @@ -48,12 +48,9 @@ export class StoryOutputs { } resolve_string (str: string): any { - const ref = OutputReference.parse(str) - if (ref) { - return this.get_output_value(ref.chapter_id, ref.output_name) - } else { - return str - } + return OutputReference.replace(str, (chapter_id, output_name) => { + return this.get_output_value(chapter_id as string, output_name as string) + }) } resolve_value (payload: any): any { diff --git a/tools/src/tester/types/eval.types.ts b/tools/src/tester/types/eval.types.ts index e65b80c3c..0686a6896 100644 --- a/tools/src/tester/types/eval.types.ts +++ b/tools/src/tester/types/eval.types.ts @@ -83,20 +83,3 @@ export enum Result { SKIPPED = 'SKIPPED', ERROR = 'ERROR', } - -export class OutputReference { - chapter_id: string - output_name: string - private constructor (chapter_id: string, output_name: string) { - this.chapter_id = chapter_id - this.output_name = output_name - } - - static parse (str: string): OutputReference | undefined { - if (str.startsWith('${') && str.endsWith('}')) { - const spl = str.slice(2, -1).split('.', 2) - return { chapter_id: spl[0], output_name: spl[1] } - } - return undefined - } -} diff --git a/tools/tests/helpers.test.ts b/tools/tests/helpers.test.ts index f91dde573..3e1f15476 100644 --- a/tools/tests/helpers.test.ts +++ b/tools/tests/helpers.test.ts @@ -8,7 +8,7 @@ */ import _ from 'lodash' -import { delete_matching_keys, find_refs, sort_array_by_keys, to_json, to_ndjson } from '../src/helpers' +import { delete_matching_keys, find_refs, sort_array_by_keys, to_json, to_ndjson, split } from '../src/helpers' describe('helpers', () => { describe('sort_array_by_keys', () => { @@ -195,4 +195,27 @@ describe('helpers', () => { })).toEqual(new Set(['#1', '#2', '#3', '#dup', '#/schemas/schema1', '#/schemas/schema2'])) }) }) + + describe('split', () => { + test('undefined', () => { + expect(split(undefined, '.')).toEqual([]) + }) + + test('one element', () => { + expect(split('str', '.')).toEqual(['str']) + expect(split('str', '.', -1)).toEqual(['str']) + expect(split('str', '.', 0)).toEqual(['str']) + expect(split('str', '.', 10)).toEqual(['str']) + }) + + test('multiple elements', () => { + expect(split('x.y.z', '.')).toEqual(['x', 'y', 'z']) + expect(split('x.y.z', '.', -1)).toEqual(['x', 'y', 'z']) + expect(split('x.y.z', '.', 0)).toEqual(['x', 'y', 'z']) + expect(split('x.y.z', '.', 1)).toEqual(['x.y.z']) + expect(split('x.y.z', '.', 2)).toEqual(['x', 'y.z']) + expect(split('x.y.z', '.', 3)).toEqual(['x', 'y', 'z']) + expect(split('x.y.z', '.', 4)).toEqual(['x', 'y', 'z']) + }) + }) }) diff --git a/tools/tests/tester/OutputReference.test.ts b/tools/tests/tester/OutputReference.test.ts new file mode 100644 index 000000000..76aa4a067 --- /dev/null +++ b/tools/tests/tester/OutputReference.test.ts @@ -0,0 +1,39 @@ +/* +* 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/OutputReference"; + +describe('OutputReference', () => { + let f = (id: any, k: any): string => `[${id}:${k}]` + + describe('parse', () => { + it('replaces', () => { + expect(OutputReference.parse('string')).toEqual([]) + expect(OutputReference.parse('${k.v}')).toEqual([new OutputReference('k', 'v')]) + expect(OutputReference.parse('${k.value}')).toEqual([new OutputReference('k', 'value')]) + expect(OutputReference.parse('${k.v.m}')).toEqual([new OutputReference('k', 'v.m')]) + expect(OutputReference.parse('A reference to ${k.v.m} and ${x.y}.')).toEqual([ + new OutputReference('k', 'v.m'), + new OutputReference('x', 'y') + ]) + }) + }) + + 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]') + expect(OutputReference.replace('A reference to ${k.v.m} and ${x} and ${x.y}.', f)).toEqual( + 'A reference to [k:v.m] and [x:undefined] and [x:y].' + ) + }) + }) +}); diff --git a/tools/tests/tester/StoryOutputs.test.ts b/tools/tests/tester/StoryOutputs.test.ts index 3017b7a66..9339a860b 100644 --- a/tools/tests/tester/StoryOutputs.test.ts +++ b/tools/tests/tester/StoryOutputs.test.ts @@ -19,7 +19,11 @@ const story_outputs = new StoryOutputs({ test('resolve_string', () => { expect(story_outputs.resolve_string('${chapter_id.x}')).toEqual(1) + expect(story_outputs.resolve_string('${chapter_id.y}')).toEqual(2) expect(story_outputs.resolve_string('${invalid_id.x}')).toBeUndefined() + expect(story_outputs.resolve_string('${invalid_id.y}')).toBeUndefined() + expect(story_outputs.resolve_string('${chapter_id.x} and ${chapter_id.y}')).toEqual('1 and 2') + expect(story_outputs.resolve_string('${chapter_id.x} and ${chapter_id.y} and ${invalid.invalid}')).toEqual('1 and 2 and undefined') expect(story_outputs.resolve_string('some_str')).toEqual('some_str') }) @@ -55,13 +59,19 @@ test('resolve_params', () => { a: '${chapter_id.x}', b: '${chapter_id.y}', c: 3, - d: 'str' + d: 'str', + e: '${chapter_id.x}:${chapter_id.y}', + f: 'x=${chapter_id.x}', + g: '${chapter_id.y}=y' } expect(story_outputs.resolve_params(parameters)).toEqual({ a: 1, b: 2, c: 3, - d: 'str' + d: 'str', + e: '1:2', + f: 'x=1', + g: '2=y' }) }) From 13013b925e0a1cc871cd2aa7416694de246fd446 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:17:33 +0500 Subject: [PATCH 05/16] hotfix of method in snapshots Signed-off-by: Tokesh --- tests/snapshot/snapshot/restore.yaml | 4 +--- tests/snapshot/snapshot/snapshot.yaml | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/snapshot/snapshot/restore.yaml b/tests/snapshot/snapshot/restore.yaml index 29c1d799b..d2eaad807 100644 --- a/tests/snapshot/snapshot/restore.yaml +++ b/tests/snapshot/snapshot/restore.yaml @@ -50,9 +50,7 @@ prologues: index: stories alias: stories_alias - path: /_snapshot/{repository}/{snapshot} - method: - - POST - - PUT + method: PUT parameters: repository: my-fs-repository snapshot: my-test-snapshot diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 2ce557f4b..8c7dcf32f 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -50,7 +50,9 @@ chapters: location: /tmp/opensearch/repo - synopsis: Create a snapshot. path: /_snapshot/{repository}/{snapshot} - method: PUT + method: + - POST + - PUT parameters: repository: my-fs-repository snapshot: my-test-snapshot From f70c2a6fb93e1f45711414bde4bc10e66af2ebdc Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:22:24 +0500 Subject: [PATCH 06/16] hotfix with snapshot tests Signed-off-by: Tokesh --- tests/snapshot/snapshot/snapshot.yaml | 36 +++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 8c7dcf32f..8b5180b9a 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -50,9 +50,31 @@ chapters: location: /tmp/opensearch/repo - synopsis: Create a snapshot. path: /_snapshot/{repository}/{snapshot} - method: - - POST - - PUT + method: POST + parameters: + repository: my-fs-repository + snapshot: my-test-snapshot + wait_for_completion: true + request: + payload: + indices: '*' + ignore_unavailable: true + include_global_state: false + partial: true + response: + status: 200 + payload: + snapshot: + snapshot: my-test-snapshot + - synopsis: Delete a snapshot. + path: /_snapshot/{repository}/{snapshot} + method: DELETE + parameters: + repository: my-fs-repository + snapshot: my-test-snapshot + - synopsis: Create a snapshot. + path: /_snapshot/{repository}/{snapshot} + method: PUT parameters: repository: my-fs-repository snapshot: my-test-snapshot @@ -67,7 +89,7 @@ chapters: status: 200 payload: snapshot: - snapshot: my-test-snapshot + snapshot: my-test-snapshot - synopsis: Get information about a snapshot. path: /_snapshot/{repository}/{snapshot} method: GET @@ -91,12 +113,6 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot - - synopsis: Delete a snapshot. - path: /_snapshot/{repository}/{snapshot} - method: DELETE - parameters: - repository: my-fs-repository - snapshot: my-test-snapshot - synopsis: Delete a snapshot repository. path: /_snapshot/{repository} method: DELETE From 7dadddd09554c76b366d4cc0a00187456e89575a Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:28:03 +0500 Subject: [PATCH 07/16] hotfix race condition Signed-off-by: Tokesh --- tests/snapshot/snapshot/snapshot.yaml | 30 ++++++--------------------- tests/snapshot/snapshot/status.yaml | 2 +- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 8b5180b9a..89732d4a6 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -66,30 +66,6 @@ chapters: payload: snapshot: snapshot: my-test-snapshot - - synopsis: Delete a snapshot. - path: /_snapshot/{repository}/{snapshot} - method: DELETE - parameters: - repository: my-fs-repository - snapshot: my-test-snapshot - - synopsis: Create a snapshot. - path: /_snapshot/{repository}/{snapshot} - method: PUT - parameters: - repository: my-fs-repository - snapshot: my-test-snapshot - wait_for_completion: true - request: - payload: - indices: '*' - ignore_unavailable: true - include_global_state: false - partial: true - response: - status: 200 - payload: - snapshot: - snapshot: my-test-snapshot - synopsis: Get information about a snapshot. path: /_snapshot/{repository}/{snapshot} method: GET @@ -113,6 +89,12 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot + - synopsis: Delete a snapshot. + path: /_snapshot/{repository}/{snapshot} + method: DELETE + parameters: + repository: my-fs-repository + snapshot: my-test-snapshot - synopsis: Delete a snapshot repository. path: /_snapshot/{repository} method: DELETE diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index af00860da..89e437c03 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -15,7 +15,7 @@ epilogues: repository: my-fs-repository prologues: - path: /_snapshot/{repository} - method: PUT + method: POST parameters: repository: my-fs-repository request: From 8faa567a161d1d67396f0a1028942f1a4b769413 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:33:35 +0500 Subject: [PATCH 08/16] adding chapter in snapshot tests Signed-off-by: Tokesh --- CHANGELOG.md | 1 - tests/snapshot/snapshot/snapshot.yaml | 33 ++++++++++++++++++++++----- tests/snapshot/snapshot/status.yaml | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 213de17b5..d41a6df28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -195,7 +195,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) - ### Changed - Replaced Smithy with a native OpenAPI spec ([#189](https://github.com/opensearch-project/opensearch-api-specification/issues/189)) diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 89732d4a6..3c51d419e 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -8,6 +8,12 @@ epilogues: parameters: repository: my-fs-repository snapshot: my-test-snapshot + - path: /_snapshot/{repository}/{snapshot} + method: DELETE + status: [200, 404] + parameters: + repository: my-sn-repository + snapshot: my-second-snapshot - path: /_snapshot/{repository} method: DELETE status: [200, 404] @@ -50,7 +56,7 @@ chapters: location: /tmp/opensearch/repo - synopsis: Create a snapshot. path: /_snapshot/{repository}/{snapshot} - method: POST + method: PUT parameters: repository: my-fs-repository snapshot: my-test-snapshot @@ -65,7 +71,22 @@ chapters: status: 200 payload: snapshot: - snapshot: my-test-snapshot + snapshot: my-test-snapshot + - synopsis: Create a second snapshot. + path: /_snapshot/{repository}/{snapshot} + method: POST + parameters: + repository: my-sn-repository + snapshot: my-second-snapshot + wait_for_completion: true + request: + payload: + indices: '*' + response: + status: 200 + payload: + snapshot: + snapshot: my-second-snapshot - synopsis: Get information about a snapshot. path: /_snapshot/{repository}/{snapshot} method: GET @@ -81,20 +102,20 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-fs-repository - snapshot: my-test-snapshot + repository: my-sn-repository + snapshot: my-second-snapshot human: true response: status: 200 payload: snapshots: - - snapshot: my-test-snapshot + - snapshot: my-second-snapshot - synopsis: Delete a snapshot. path: /_snapshot/{repository}/{snapshot} method: DELETE parameters: repository: my-fs-repository - snapshot: my-test-snapshot + snapshot: my-test-snapshot - synopsis: Delete a snapshot repository. path: /_snapshot/{repository} method: DELETE diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index 89e437c03..af00860da 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -15,7 +15,7 @@ epilogues: repository: my-fs-repository prologues: - path: /_snapshot/{repository} - method: POST + method: PUT parameters: repository: my-fs-repository request: From e9575bac2c855a7c866b51d3197b06e42cebe5e9 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:36:30 +0500 Subject: [PATCH 09/16] correcting path to repository in snapshot tests Signed-off-by: Tokesh --- tests/snapshot/snapshot/snapshot.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 3c51d419e..79e6bb597 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -12,7 +12,7 @@ epilogues: method: DELETE status: [200, 404] parameters: - repository: my-sn-repository + repository: my-fs-repository snapshot: my-second-snapshot - path: /_snapshot/{repository} method: DELETE @@ -76,7 +76,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: POST parameters: - repository: my-sn-repository + repository: my-fs-repository snapshot: my-second-snapshot wait_for_completion: true request: @@ -102,7 +102,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-sn-repository + repository: my-fs-repository snapshot: my-second-snapshot human: true response: From d23bf4ab5121c6470ce439a42d6598f1a84ab955 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:39:30 +0500 Subject: [PATCH 10/16] adding verbose to check ci Signed-off-by: Tokesh --- .github/workflows/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index d166b375f..bc8f538a1 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -100,7 +100,7 @@ jobs: run: | npm run test:spec -- \ --opensearch-insecure \ - --opensearch-version=${{ matrix.entry.version }} \ + --opensearch-version=${{ matrix.entry.version }} --verbose\ --coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \ --opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \ --opensearch-cert=${{ matrix.entry.cert }} \ From e7ff570a1f7285976f03c3688a6b41f75a3e1d23 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:44:44 +0500 Subject: [PATCH 11/16] deleting verbose Signed-off-by: Tokesh --- .github/workflows/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index bc8f538a1..d166b375f 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -100,7 +100,7 @@ jobs: run: | npm run test:spec -- \ --opensearch-insecure \ - --opensearch-version=${{ matrix.entry.version }} --verbose\ + --opensearch-version=${{ matrix.entry.version }} \ --coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \ --opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \ --opensearch-cert=${{ matrix.entry.cert }} \ From f9da013800e7226807b88d3b3a9a2b4b941959a4 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:47:20 +0500 Subject: [PATCH 12/16] added retry to status in snapshots Signed-off-by: Tokesh --- tests/snapshot/snapshot/status.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index af00860da..b75f8bc06 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -43,6 +43,9 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot + retry: + count: 3 + wait: 30000 - synopsis: Get status of all running snapshots in specific repository. path: /_snapshot/{repository}/_status method: GET From e97eee9b487655aeb55cd57f2734d9c1e244015a Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:49:23 +0500 Subject: [PATCH 13/16] added retry to correct place Signed-off-by: Tokesh --- tests/snapshot/snapshot/status.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index b75f8bc06..73f1da21b 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -43,9 +43,6 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot - retry: - count: 3 - wait: 30000 - synopsis: Get status of all running snapshots in specific repository. path: /_snapshot/{repository}/_status method: GET @@ -56,6 +53,9 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot + retry: + count: 3 + wait: 30000 - synopsis: Get status of specific snapshot in specific repository. path: /_snapshot/{repository}/{snapshot}/_status method: GET From aeb2aedd1ce7d5766317cbc2b116c4abbd0639cc Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 18 Dec 2024 23:53:04 +0500 Subject: [PATCH 14/16] adding verbose to check Signed-off-by: Tokesh --- .github/workflows/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index d166b375f..ac4245c85 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -99,7 +99,7 @@ jobs: - name: Run Tests run: | npm run test:spec -- \ - --opensearch-insecure \ + --opensearch-insecure --verbose \ --opensearch-version=${{ matrix.entry.version }} \ --coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \ --opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \ From e802d7c8889b56b7a5f568f09a792f29dc89d64e Mon Sep 17 00:00:00 2001 From: Tokesh Date: Thu, 19 Dec 2024 00:09:55 +0500 Subject: [PATCH 15/16] renaming to avoid race condition Signed-off-by: Tokesh --- .github/workflows/test-spec.yml | 2 +- tests/snapshot/snapshot/snapshot.yaml | 26 +++++++++++++------------- tests/snapshot/snapshot/status.yaml | 3 --- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index ac4245c85..d166b375f 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -99,7 +99,7 @@ jobs: - name: Run Tests run: | npm run test:spec -- \ - --opensearch-insecure --verbose \ + --opensearch-insecure \ --opensearch-version=${{ matrix.entry.version }} \ --coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \ --opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \ diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index 79e6bb597..abfc2198f 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -6,19 +6,19 @@ epilogues: method: DELETE status: [200, 404] parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-test-snapshot - path: /_snapshot/{repository}/{snapshot} method: DELETE status: [200, 404] parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-second-snapshot - path: /_snapshot/{repository} method: DELETE status: [200, 404] parameters: - repository: my-fs-repository + repository: my-repository chapters: - synopsis: Create and update a snapshot repository. path: /_snapshot/{repository} @@ -26,7 +26,7 @@ chapters: - POST - PUT parameters: - repository: my-fs-repository + repository: my-repository request: payload: type: fs @@ -38,7 +38,7 @@ chapters: response: status: 200 payload: - my-fs-repository: + my-repository: type: fs settings: location: /tmp/opensearch/repo @@ -46,11 +46,11 @@ chapters: path: /_snapshot/{repository} method: GET parameters: - repository: my-fs-repository + repository: my-repository response: status: 200 payload: - my-fs-repository: + my-repository: type: fs settings: location: /tmp/opensearch/repo @@ -58,7 +58,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: PUT parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-test-snapshot wait_for_completion: true request: @@ -76,7 +76,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: POST parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-second-snapshot wait_for_completion: true request: @@ -91,7 +91,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-test-snapshot response: status: 200 @@ -102,7 +102,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-second-snapshot human: true response: @@ -114,10 +114,10 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: DELETE parameters: - repository: my-fs-repository + repository: my-repository snapshot: my-test-snapshot - synopsis: Delete a snapshot repository. path: /_snapshot/{repository} method: DELETE parameters: - repository: my-fs-repository + repository: my-repository diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index 73f1da21b..af00860da 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -53,9 +53,6 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot - retry: - count: 3 - wait: 30000 - synopsis: Get status of specific snapshot in specific repository. path: /_snapshot/{repository}/{snapshot}/_status method: GET From 9dedc0fbc8e774406acb5d0c9a77005ff2f2aca5 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Thu, 19 Dec 2024 14:52:13 +0500 Subject: [PATCH 16/16] refactoring folder organization, adding retries, fixing naming Signed-off-by: Tokesh --- .../rethrottle.yaml} | 6 ++--- tests/snapshot/snapshot/snapshot.yaml | 26 +++++++++---------- tests/snapshot/snapshot/status.yaml | 2 ++ 3 files changed, 18 insertions(+), 16 deletions(-) rename tests/default/_core/{update_by_query.yaml => update_by_query/rethrottle.yaml} (74%) diff --git a/tests/default/_core/update_by_query.yaml b/tests/default/_core/update_by_query/rethrottle.yaml similarity index 74% rename from tests/default/_core/update_by_query.yaml rename to tests/default/_core/update_by_query/rethrottle.yaml index 40a1ad72e..d1f27c0d1 100644 --- a/tests/default/_core/update_by_query.yaml +++ b/tests/default/_core/update_by_query/rethrottle.yaml @@ -1,8 +1,8 @@ -$schema: ../../../json_schemas/test_story.schema.yaml +$schema: ../../../../json_schemas/test_story.schema.yaml -description: Test Update By Query endpoint. +description: Test Update By Query rethrottle endpoint. prologues: - - path: /books/_delete_by_query + - path: /books/_update_by_query id: task method: POST parameters: diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index abfc2198f..79e6bb597 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -6,19 +6,19 @@ epilogues: method: DELETE status: [200, 404] parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-test-snapshot - path: /_snapshot/{repository}/{snapshot} method: DELETE status: [200, 404] parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-second-snapshot - path: /_snapshot/{repository} method: DELETE status: [200, 404] parameters: - repository: my-repository + repository: my-fs-repository chapters: - synopsis: Create and update a snapshot repository. path: /_snapshot/{repository} @@ -26,7 +26,7 @@ chapters: - POST - PUT parameters: - repository: my-repository + repository: my-fs-repository request: payload: type: fs @@ -38,7 +38,7 @@ chapters: response: status: 200 payload: - my-repository: + my-fs-repository: type: fs settings: location: /tmp/opensearch/repo @@ -46,11 +46,11 @@ chapters: path: /_snapshot/{repository} method: GET parameters: - repository: my-repository + repository: my-fs-repository response: status: 200 payload: - my-repository: + my-fs-repository: type: fs settings: location: /tmp/opensearch/repo @@ -58,7 +58,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: PUT parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-test-snapshot wait_for_completion: true request: @@ -76,7 +76,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: POST parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-second-snapshot wait_for_completion: true request: @@ -91,7 +91,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-test-snapshot response: status: 200 @@ -102,7 +102,7 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: GET parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-second-snapshot human: true response: @@ -114,10 +114,10 @@ chapters: path: /_snapshot/{repository}/{snapshot} method: DELETE parameters: - repository: my-repository + repository: my-fs-repository snapshot: my-test-snapshot - synopsis: Delete a snapshot repository. path: /_snapshot/{repository} method: DELETE parameters: - repository: my-repository + repository: my-fs-repository diff --git a/tests/snapshot/snapshot/status.yaml b/tests/snapshot/snapshot/status.yaml index af00860da..bc93b334e 100644 --- a/tests/snapshot/snapshot/status.yaml +++ b/tests/snapshot/snapshot/status.yaml @@ -34,6 +34,8 @@ prologues: ignore_unavailable: true include_global_state: false partial: true + retry: + count: 3 chapters: - synopsis: Get status of all running snapshots. path: /_snapshot/_status