diff --git a/tools/src/tester/types/eval.types.ts b/tools/src/tester/types/eval.types.ts index 1e140fd4..c778a144 100644 --- a/tools/src/tester/types/eval.types.ts +++ b/tools/src/tester/types/eval.types.ts @@ -28,7 +28,6 @@ export interface StoryEvaluation { full_path: string description: string message?: string - pending?: string chapters?: ChapterEvaluation[] epilogues?: ChapterEvaluation[] prologues?: ChapterEvaluation[] @@ -44,6 +43,7 @@ export interface ChapterEvaluation { overall: Evaluation, operation?: Operation, path?: string, + pending?: string, request?: { parameters?: Record request?: Evaluation diff --git a/tools/tests/tester/fixtures/evals/ignored/ignore.yaml b/tools/tests/tester/fixtures/evals/ignored/ignore.yaml new file mode 100644 index 00000000..df626061 --- /dev/null +++ b/tools/tests/tester/fixtures/evals/ignored/ignore.yaml @@ -0,0 +1,15 @@ +display_path: ignored/ignored.yaml +full_path: tools/tests/tester/fixtures/stories/ignored/ignore.yaml + +result: PASSED +description: This story should ignored. +prologues: [] +chapters: + - title: This PUT /{index} chapter should pending. + overall: + result: IGNORED + message: This chapter is ignored because it is not relevant to the current test. +epilogues: + - title: DELETE /books + overall: + result: PASSED \ No newline at end of file diff --git a/tools/tests/tester/fixtures/stories/ignored/ignored.yaml b/tools/tests/tester/fixtures/stories/ignored/ignored.yaml new file mode 100644 index 00000000..ce6ad921 --- /dev/null +++ b/tools/tests/tester/fixtures/stories/ignored/ignored.yaml @@ -0,0 +1,14 @@ +$schema: ../../../../../../json_schemas/test_story.schema.yaml + +description: This story should ignored. +epilogues: + - path: /books + method: DELETE + status: [200, 404] +chapters: + - synopsis: This PUT /{index} chapter should pending. + path: /{index} + pending: This chapter is ignored because it is not relevant to the current test. + method: PUT + parameters: + index: books diff --git a/tools/tests/tester/integ/StoryEvaluator.test.ts b/tools/tests/tester/integ/StoryEvaluator.test.ts index cae1de74..e2d07e2f 100644 --- a/tools/tests/tester/integ/StoryEvaluator.test.ts +++ b/tools/tests/tester/integ/StoryEvaluator.test.ts @@ -69,6 +69,12 @@ test('skipped/semver', async () => { expect(actual).toEqual(expected) }) +test('ignored', async () => { + const actual = await load_actual_evaluation(story_evaluator, 'skipped/semver') + const expected = load_expected_evaluation('skipped/semver') + expect(actual).toEqual(expected) +}) + test('with an unexpected error deserializing data', async () => { opensearch_http_client.request = jest.fn().mockRejectedValue(new Error('This was unexpected.')) const actual = await load_actual_evaluation(story_evaluator, 'passed/passed') diff --git a/tools/tests/tester/integ/TestRunner.test.ts b/tools/tests/tester/integ/TestRunner.test.ts index 8e2bfb35..30370d4d 100644 --- a/tools/tests/tester/integ/TestRunner.test.ts +++ b/tools/tests/tester/integ/TestRunner.test.ts @@ -34,6 +34,7 @@ test('stories folder', async () => { 'error/prologue_error', 'failed/invalid_data', 'failed/not_found', + 'ignored/ignore', 'passed/multiple_methods', 'passed/passed', 'passed/value_type',