diff options
author | pmikus <peter.mikus@protonmail.ch> | 2023-03-13 08:22:17 +0000 |
---|---|---|
committer | pmikus <peter.mikus@protonmail.ch> | 2023-03-13 08:34:22 +0000 |
commit | 0968ab87778dd1cad67a49315e2df49b0d076297 (patch) | |
tree | 0a859a9d04122d227a78335b31d837aa9b8dd1be | |
parent | ee9f4b4433d3a4b72b9d3e43c480a56892e8c8b6 (diff) |
feat(model): Move schema to resources
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: I905921cc93436c0e0f1c22dfbdc2af62f4b04ac0
-rw-r--r-- | docs/model/current/top.rst | 75 | ||||
-rw-r--r-- | resources/libraries/python/model/validate.py | 2 | ||||
-rw-r--r-- | resources/model_schema/test_case.schema.yaml (renamed from docs/model/current/schema/test_case.info.schema.yaml) | 0 |
3 files changed, 1 insertions, 76 deletions
diff --git a/docs/model/current/top.rst b/docs/model/current/top.rst deleted file mode 100644 index 721e6b2ff0..0000000000 --- a/docs/model/current/top.rst +++ /dev/null @@ -1,75 +0,0 @@ -.. - Copyright (c) 2023 Cisco and/or its affiliates. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at: -.. - http://www.apache.org/licenses/LICENSE-2.0 -.. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -CSIT model -^^^^^^^^^^ - -This document describes what is currently implemented in CSIT, -especially the export side (UTI), not import side (PAL). - -Version -~~~~~~~ - -This document is valid for CSIT model version 1.4.0. - -It is recommended to use semantic versioning: https://semver.org/ -That means, if the new model misses a field present in the old model, -bump the major version. If the new model adds a field -not present in the old model, bump the minor version. -Any other edit in the implmenetation (or documentation) bumps the patch version. -If you change value type or formatting, -consider whether the parser (PAL) understands the new value correctly. -Renaming a field is the same as adding a new one and removing the old one. -Parser (PAL) has to know exact major version and minimal minor version, -and unless bugs, it can ignore patch version and bumped minor version. - -UTI -~~~ - -UTI stands for Unified Test Interface. -It mainly focuses on exporting information gathered during test run -into JSON output files. - -Output Structure ------------------ - -UTI outputs come in filesystem tree structure (single tree), where directories -correspond to suite levels and files correspond to suite setup, suite teardown -or any test case at this level of suite. -The directory name comes from SUITE_NAME Robot variable (the last part -as the previous parts are higher level suites), converted to lowercase. -If the suite name contains spaces (Robot converts underscores to spaces), -they are replaced with underscores. - -The filesystem tree is rooted under tests/ (as suites in git are there), -and for each component (test case, suite setup, suite teardown). - -Although we expect only ASCII text in the exported files, -we manipulate files using UTF-8 encoding, -so if Robot Framework uses a non-ascii character, it will be handled. - -JSON schemas ------------- - -CSIT model is formally defined as a collection of JSON schema documents, -one for each output file type. - -The current version specifies only one output file type: -Info output for test case. - -The authoritative JSON schema documents are in JSON format. -Git repository also contains YAML formatted document and conversion utility, -which simplifies maintaining of the JSON document -(no need to track brackets and commas), but are not authoritative. diff --git a/resources/libraries/python/model/validate.py b/resources/libraries/python/model/validate.py index 47948addeb..ee82d3289f 100644 --- a/resources/libraries/python/model/validate.py +++ b/resources/libraries/python/model/validate.py @@ -31,7 +31,7 @@ def get_validators(): :rtype: Mapping[str, jsonschema.validators.Validator] :raises RuntimeError: If schemas are not readable or not valid. """ - relative_path = "docs/model/current/schema/test_case.info.schema.yaml" + relative_path = "resources/model_schema/test_case.schema.yaml" # Robot is always started when CWD is CSIT_DIR. with open(relative_path, "rt", encoding="utf-8") as file_in: schema = json.loads( diff --git a/docs/model/current/schema/test_case.info.schema.yaml b/resources/model_schema/test_case.schema.yaml index 5d33e0e149..5d33e0e149 100644 --- a/docs/model/current/schema/test_case.info.schema.yaml +++ b/resources/model_schema/test_case.schema.yaml |