Skip to content

Commit

Permalink
Remove ability to skip stories in tests.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jun 21, 2024
1 parent 33aa91a commit b53bba6
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 58 deletions.
1 change: 0 additions & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ Below is the simplified version of the test story that tests the [index operatio
```yaml
$schema: ../json_schemas/test_story.schema.yaml # The schema of the test story. Include this line so that your editor can validate the test story on the fly.
skip: false # Skip this test story if set to true.
description: This story tests all endpoints relevant the lifecycle of an index, from creation to deletion.
prologues: [] # No prologues are needed for this story.
Expand Down
4 changes: 0 additions & 4 deletions json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ type: object
properties:
$schema:
type: string
skip:
type: boolean
description: If true, the story will be skipped.
default: false
description:
type: string
prologues:
Expand Down
1 change: 0 additions & 1 deletion tests/_core/info.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

$schema: ../../json_schemas/test_story.schema.yaml

skip: false
description: Test root endpoint.
chapters:
- synopsis: Get server info.
Expand Down
1 change: 0 additions & 1 deletion tests/indices/_doc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$schema: ../../json_schemas/test_story.schema.yaml

skip: false
description: Test inserting and retrieving a doc.
epilogues:
- path: /movies
Expand Down
1 change: 0 additions & 1 deletion tests/indices/index.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$schema: ../../json_schemas/test_story.schema.yaml

skip: false
description: Test endpoints relevant the lifecycle of an index, from creation to deletion.
epilogues:
- path: /books
Expand Down
1 change: 0 additions & 1 deletion tests/ingest/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$schema: ../../json_schemas/test_story.schema.yaml

skip: false
description: |
Test the creation of an ingest pipeline with a text embedding processor.
epilogues:
Expand Down
1 change: 0 additions & 1 deletion tests/ml/model_groups.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$schema: ../../json_schemas/test_story.schema.yaml

skip: false
description: |
Test the creation of model groups.
epilogues:
Expand Down
9 changes: 0 additions & 9 deletions tools/src/tester/StoryEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ export default class StoryEvaluator {
}

async evaluate({ story, display_path, full_path }: StoryFile, dry_run: boolean = false): Promise<StoryEvaluation> {
if (story.skip) {
return {
result: Result.SKIPPED,
display_path,
full_path,
description: story.description,
chapters: []
}
}
const variables_error = StoryEvaluator.check_story_variables(story, display_path, full_path)
if (variables_error !== undefined) {
return variables_error
Expand Down
4 changes: 0 additions & 4 deletions tools/src/tester/types/story.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export type ReadChapter = Chapter & {

export interface Story {
$schema?: string;
/**
* If true, the story will be skipped.
*/
skip?: boolean;
description: string;
prologues?: SupplementalChapter[];
epilogues?: SupplementalChapter[];
Expand Down
2 changes: 0 additions & 2 deletions tools/tests/tester/fixtures/empty_with_all_the_parts.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
$schema: ../json_schemas/test_story.schema.yaml

skip: false

description: A story with all its parts.

prologues:
Expand Down
7 changes: 0 additions & 7 deletions tools/tests/tester/fixtures/evals/skipped.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$schema: ../json_schemas/test_story.schema.yaml

skip: false
description: |
This test story checks that we can create a model group
chapters:
Expand Down
17 changes: 0 additions & 17 deletions tools/tests/tester/fixtures/stories/skipped.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions tools/tests/tester/integ/StoryEvaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ test('passed', async () => {
expect(actual).toEqual(expected)
})

test('skipped', async () => {
const actual = await load_actual_evaluation(story_evaluator, 'skipped')
const expected = load_expected_evaluation('skipped')
expect(actual).toEqual(expected)
})

test('failed/not_found', async () => {
const actual = await load_actual_evaluation(story_evaluator, 'failed/not_found')
const expected = load_expected_evaluation('failed/not_found')
Expand Down
3 changes: 1 addition & 2 deletions tools/tests/tester/integ/TestRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ test('stories folder', async () => {
actual_evaluations.push(rest)
}

const skipped = load_expected_evaluation('skipped', true)
const passed = load_expected_evaluation('passed', true)
const not_found = load_expected_evaluation('failed/not_found', true)
const invalid_data = load_expected_evaluation('failed/invalid_data', true)
const chapter_error = load_expected_evaluation('error/chapter_error', true)
const prologue_error = load_expected_evaluation('error/prologue_error', true)

const expected_evaluations = [passed, skipped, chapter_error, prologue_error, invalid_data, not_found]
const expected_evaluations = [passed, chapter_error, prologue_error, invalid_data, not_found]
expect(actual_evaluations).toEqual(expected_evaluations)
})

0 comments on commit b53bba6

Please sign in to comment.