Skip to content

Commit

Permalink
vtesttree-schema-v1 (#2912)
Browse files Browse the repository at this point in the history
* Add vtesttree schema

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
TizianHoffmann and pre-commit-ci[bot] authored Apr 20, 2023
1 parent 297e174 commit d866901
Show file tree
Hide file tree
Showing 14 changed files with 270 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,12 @@
"fileMatch": ["vss-extension.json"],
"url": "https://json.schemastore.org/vss-extension.json"
},
{
"name": "vtesttree.yaml",
"description": "Test execution tree description for a Vector test unit created with VS Code",
"fileMatch": ["*.vtesttree.yaml", "*.vtesttree.yml", "*.vtesttree.json"],
"url": "https://json.schemastore.org/vtesttree-schema.json"
},
{
"name": "v8r",
"description": "v8r configuration file schema",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: 0.0.0
test-tree:
- capl-test-case: MyTestCase
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test-tree:
- capl-test-case: MyTestCase
194 changes: 194 additions & 0 deletions src/schemas/json/vtesttree-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"$ref": "#/definitions/95c8/full",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"95c8": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Json schema for vtesttree.yaml files.",
"type": "object",
"required": ["version"],
"oneOf": [
{
"allOf": [
{
"properties": {
"version": {
"const": "1.0.0"
}
}
},
{
"$ref": "#/definitions/9261/full"
}
]
}
]
}
},
"9261": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Json schema for vtesttree.yaml files.",
"type": "object",
"additionalProperties": false,
"required": ["version"],
"properties": {
"version": {
"$ref": "#/definitions/2493/full"
},
"test-tree": {
"$ref": "#/definitions/60dd/full"
}
}
}
},
"2493": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Version",
"description": "Json schema version for the vtesttree.yaml file. Acceptance criteria: equal major version, less/equal minor and patch version.",
"const": "1.0.0",
"type": "string",
"examples": ["1.0.0"]
}
},
"60dd": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Test tree",
"description": "Definition of a test tree consisting of test groups, CAPL test cases or CAPL test sequences.",
"type": "array",
"items": {
"$ref": "#/definitions/98ab/full"
}
}
},
"98ab": {
"full": {
"description": "Element of a test tree or test group.",
"oneOf": [
{
"$ref": "#/definitions/98d3/full"
},
{
"$ref": "#/definitions/a74b/full"
},
{
"$ref": "#/definitions/9587/full"
}
]
}
},
"98d3": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CAPL test case",
"description": "Definition of a call to a CAPL test case.",
"type": "object",
"required": ["capl-test-case"],
"additionalProperties": false,
"properties": {
"capl-test-case": {
"type": "string",
"description": "Function name of the CAPL test case."
},
"id": {
"type": "string",
"description": "Identifier of the test case."
},
"title": {
"type": "string",
"description": "Title of the CAPL test case."
},
"description": {
"type": "string",
"description": "Description of the CAPL test case"
},
"params": {
"$ref": "#/definitions/fd91/full"
}
}
}
},
"a74b": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CAPL test sequence",
"description": "Definition of a call to a CAPL test sequence.",
"type": "object",
"required": ["capl-test-sequence"],
"additionalProperties": false,
"properties": {
"capl-test-sequence": {
"type": "string",
"description": "Function name of the CAPL test sequence."
},
"title": {
"type": "string",
"description": "Title of the CAPL test sequence."
},
"params": {
"$ref": "#/definitions/fd91/full"
}
}
}
},
"9587": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Test group",
"description": "Definition of a test group containing other test groups, CAPL test cases or CAPL test sequences",
"type": "object",
"required": ["test-group"],
"additionalProperties": false,
"properties": {
"test-group": {
"type": "string",
"description": "Name of the test group."
},
"description": {
"type": "string",
"description": "Description of the test group."
},
"elements": {
"type": "array",
"items": {
"$ref": "#/definitions/98ab/full"
}
}
}
}
},
"fd91": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CAPL parameter list",
"description": "List of parameter values for a CAPL test case or CAPL test sequence.",
"type": "array",
"items": {
"$ref": "#/definitions/8692/full"
}
}
},
"8692": {
"full": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CAPL parameter",
"description": "Parameter value for a CAPL test case or CAPL test sequence.",
"anyOf": [
{
"title": "Numeric Value",
"type": "number"
},
{
"title": "String Value",
"type": "string"
}
]
}
}
},
"title": "Json schema for vtesttree.yaml files.",
"type": "object"
}
5 changes: 5 additions & 0 deletions src/test/vtesttree-schema/empty-parameters.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1.0.0

test-tree:
- capl-test-case: test
params: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1.0.0
test-tree:
- test-group: TestGroup
elements: []
3 changes: 3 additions & 0 deletions src/test/vtesttree-schema/empty-test-group.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: 1.0.0
test-tree:
- test-group: TestGroup
2 changes: 2 additions & 0 deletions src/test/vtesttree-schema/empty-tree.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: 1.0.0
test-tree: []
1 change: 1 addition & 0 deletions src/test/vtesttree-schema/empty.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: 1.0.0
16 changes: 16 additions & 0 deletions src/test/vtesttree-schema/full-tree.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 1.0.0
test-tree:
- capl-test-case: CaplTestCase
id: 164edfde-9eb6-491a-8eb0-46e8b69a61d0
- capl-test-sequence: CaplTestSequence
- test-group: Outer Group
elements:
- capl-test-case: CaplTestCase
id: 126a6aab-6d01-44e5-8ada-92ad6d97de52
- capl-test-sequence: CaplTestSequence
- test-group: Inner Group
elements:
- capl-test-case: CaplTestCase
id: 7202539c-eb29-490b-9b50-b76b7a9b55b1
- capl-test-sequence: CaplTestSequence
title: Test Sequence with Title
13 changes: 13 additions & 0 deletions src/test/vtesttree-schema/mixed-parameters.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 1.0.0
test-tree:
- capl-test-sequence: FullyParametrizedTestSequence
params:
- -1
- 2
- -16
- 4
- 48
- -9
- 1.5
- -1.5
- test
13 changes: 13 additions & 0 deletions src/test/vtesttree-schema/nested-groups.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 1.0.0
test-tree:
- test-group: Outer Group
elements:
- test-group: Inner Layer 1
elements:
- test-group: Inner Layer 2
elements:
- test-group: Inner Layer 3
elements:
- test-group: Inner Layer 4
description: My Description
- capl-test-case: MyTestCase
3 changes: 3 additions & 0 deletions src/test/vtesttree-schema/simple-test-case.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: 1.0.0
test-tree:
- capl-test-case: MyTestCase
5 changes: 5 additions & 0 deletions src/test/vtesttree-schema/test-sequence-params.vtesttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1.0.0
test-tree:
- capl-test-sequence: MyTestSequence
params:
- 1

0 comments on commit d866901

Please sign in to comment.