Schemas

Test execution configuration

execution-configuration.schema.json
{
  "title": "Test description",
  "description": "JIRA/XRAY issue metadata definition",
  "type": "object",
  "properties": {
    "test_plans": {
      "description": "",
      "type": "array",
      "items": {
        "properties": {
          "select_from_tag": {
            "$ref": "#/$defs/defaultprop"
          }
        },
        "required": [
          "select_from_tag"
        ],
        "additionalProperties": false
      }
    },
    "name": {
      "description": "",
      "$ref": "#/$defs/mapping"
    },
    "chart_info": {
      "description": "",
      "$ref": "#/$defs/mapping"
    },
    "test_report": {
      "description": "",
      "type": "string"
    },
    "jira_url": {
      "type": "string",
      "default": "https://jira.skatelescope.org"
    },
    "project": {
      "$ref": "#/$defs/Project"
    },
    "description": {
      "description": "",
      "type": "string"
    },
    "test_environments": {
      "description": "",
      "type": "array",
      "items": {
        "$ref": "#/$defs/mapping"
      }
    },
    "labels": {
      "description": "",
      "type": "array",
      "items": {
        "$ref": "#/$defs/mapping"
      }
    },
    "versions": {
      "description": "",
      "type": "array",
      "items": {
        "$ref": "#/$defs/mapping"
      }
    },
    "environment_variables": {
      "description": "",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "test_plans",
    "name",
    "description",
    "chart_info",
    "test_report",
    "versions",
    "test_environments",
    "environment_variables"
  ],
  "additionalProperties": false,
  "$defs": {
    "defaultprop": {
      "type": "object",
      "properties": {
        "default": {
          "type": "string"
        }
      },
      "required": [
        "default"
      ],
      "additionalProperties": {
        "type": "string"
      }
    },
    "mapping": {
      "type": "object",
      "properties": {
        "env": {
          "type": "string"
        },
        "maps_to": {
          "$ref": "#/$defs/defaultprop"
        }
      },
      "required": [
        "env",
        "maps_to"
      ],
      "additionalProperties": false
    },
    "CustomfieldMapping": {
      "title": "CustomfieldMapping",
      "type": "object",
      "properties": {
        "start_date": {
          "title": "Start Date",
          "default": "customfield_11918",
          "type": "string"
        },
        "end_date": {
          "title": "End Date",
          "default": "customfield_11917",
          "type": "string"
        },
        "test_plans": {
          "title": "Test Plans",
          "default": "customfield_11927",
          "type": "string"
        },
        "test_environments": {
          "title": "Test Environments",
          "default": "customfield_11925",
          "type": "string"
        }
      }
    },
    "Project": {
      "title": "Project",
      "type": "object",
      "properties": {
        "id": {
          "title": "Id",
          "default": "XTP",
          "type": "string"
        },
        "issuetype_id": {
          "title": "Test Execution issue type id",
          "type": "integer"
        },
        "customfield_mapping": {
          "title": "Customfield Mapping",
          "$ref": "#/$defs/CustomfieldMapping"
        }
      },
      "additionalProperties": false
    }
  }
}

Cucumber

cucumber.schema.json
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "tag": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        }
      },
      "required": ["name"]
    },
    "feature": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "keyword": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/tag"
          }
        },
        "elements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/element"
          }
        }
      },
      "required": ["name", "uri"]
    },
    "element": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/tag"
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/step"
          }
        }
      },
      "required": ["type", "line", "name"]
    },
    "step": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "hidden": {
          "type": "boolean"
        },
        "result": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "passed", "Passed", "PASSED",
                "failed", "Failed", "FAILED",
                "undefined", "Undefined", "UNDEFINED",
                "skipped", "Skipped", "SKIPPED",
                "pending", "Pending", "PENDING",
                "ambiguous", "Ambiguous", "AMBIGUOUS"
              ]
            },
            "duration": {
              "type": "number"
            },
            "error_message": {
              "type": "string"
            }
          },
          "required": ["status"],
          "if": {
            "properties": { "status": { "pattern": "^(?:f|F)(?:ailed|AILED)$" } }
          },
          "then": {
            "required": ["error_message"]
          }
        }
      },
      "required": ["keyword"],
      "if": {
        "not": {
          "properties": { "hidden": { "const": true } },
          "required": ["hidden"]
        }
      },
      "then": {
        "required": ["line"]
      }


    }
  },
  "type": "array",
  "items": {
    "$ref": "#/definitions/feature"
  }
}

JIRA test execution info

jira-info.schema.json
{
    "title": "JiraInfoModel",
    "type": "object",
    "properties": {
        "fields": {
            "$ref": "#/definitions/FieldModel"
        }
    },
    "required": [
        "fields"
    ],
    "definitions": {
        "FieldModel": {
            "title": "FieldModel",
            "type": "object",
            "properties": {
                "project": {
                    "title": "Project",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "description": {
                    "title": "Description",
                    "type": "string"
                },
                "summary": {
                    "title": "Summary",
                    "type": "string"
                },
                "issuetype": {
                    "title": "Issuetype",
                    "type": "object",
                    "additionalProperties": {
                        "type": "integer"
                    }
                },
                "labels": {
                    "title": "Labels",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "customfield_11918": {
                    "title": "Customfield 11918",
                    "type": "string"
                },
                "customfield_11917": {
                    "title": "Customfield 11917",
                    "type": "string"
                },
                "customfield_11927": {
                    "title": "Customfield 11927",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "customfield_11925": {
                    "title": "Customfield 11925",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "versions": {
                    "title": "Versions",
                    "type": "array",
                    "items": {}
                },
                "fixVersions": {
                    "title": "Fixversions",
                    "type": "array",
                    "items": {}
                }
            },
            "required": [
                "project",
                "description",
                "summary",
                "issuetype",
                "labels",
                "customfield_11918",
                "customfield_11917",
                "customfield_11927",
                "customfield_11925"
            ]
        }
    }
}

pytest-json-report

pytest-report.schema.json
{
    "title": "ReportModel",
    "type": "object",
    "properties": {
        "created": {
            "title": "Created",
            "type": "number"
        },
        "duration": {
            "title": "Duration",
            "type": "number"
        },
        "exitcode": {
            "title": "Exitcode",
            "type": "integer"
        },
        "root": {
            "title": "Root",
            "type": "string"
        },
        "environment": {
            "$ref": "#/definitions/Environment"
        },
        "summary": {
            "$ref": "#/definitions/Summary"
        },
        "collectors": {
            "title": "Collectors",
            "type": "array",
            "items": {
                "$ref": "#/definitions/Collector"
            }
        },
        "tests": {
            "title": "Tests",
            "type": "array",
            "items": {
                "$ref": "#/definitions/Test"
            }
        },
        "warnings": {
            "title": "Warnings",
            "type": "array",
            "items": {
                "$ref": "#/definitions/Warning"
            }
        }
    },
    "required": [
        "created",
        "duration",
        "tests",
        "summary"
    ],
    "definitions": {
        "Packages": {
            "title": "Packages",
            "type": "object",
            "properties": {
                "pytest": {
                    "title": "Pytest",
                    "type": "string"
                },
                "py": {
                    "title": "Py",
                    "type": "string"
                },
                "pluggy": {
                    "title": "Pluggy",
                    "type": "string"
                }
            },
            "required": [
                "pytest"
            ]
        },
        "Plugins": {
            "title": "Plugins",
            "type": "object",
            "properties": {
                "cov": {
                    "title": "Cov",
                    "type": "string"
                },
                "json-report": {
                    "title": "Json-Report",
                    "type": "string"
                },
                "pycodestyle": {
                    "title": "Pycodestyle",
                    "type": "string"
                },
                "bdd": {
                    "title": "Bdd",
                    "type": "string"
                },
                "forked": {
                    "title": "Forked",
                    "type": "string"
                },
                "metadata": {
                    "title": "Metadata",
                    "type": "string"
                },
                "pylint": {
                    "title": "Pylint",
                    "type": "string"
                },
                "pydocstyle": {
                    "title": "Pydocstyle",
                    "type": "string"
                },
                "mock": {
                    "title": "Mock",
                    "type": "string"
                }
            },
            "required": [
                "json-report",
                "bdd"
            ]
        },
        "Environment": {
            "title": "Environment",
            "type": "object",
            "properties": {
                "Python": {
                    "title": "Python",
                    "type": "string"
                },
                "Platform": {
                    "title": "Platform",
                    "type": "string"
                },
                "Packages": {
                    "$ref": "#/definitions/Packages"
                },
                "Plugins": {
                    "$ref": "#/definitions/Plugins"
                },
                "CI": {
                    "title": "Ci",
                    "type": "string"
                },
                "CI_COMMIT_REF_NAME": {
                    "title": "Ci Commit Ref Name",
                    "type": "string"
                },
                "CI_COMMIT_REF_SLUG": {
                    "title": "Ci Commit Ref Slug",
                    "type": "string"
                },
                "CI_COMMIT_SHA": {
                    "title": "Ci Commit Sha",
                    "type": "string"
                },
                "CI_JOB_ID": {
                    "title": "Ci Job Id",
                    "type": "string"
                },
                "CI_JOB_MANUAL": {
                    "title": "Ci Job Manual",
                    "type": "string"
                },
                "CI_JOB_NAME": {
                    "title": "Ci Job Name",
                    "type": "string"
                },
                "CI_JOB_STAGE": {
                    "title": "Ci Job Stage",
                    "type": "string"
                },
                "CI_RUNNER_DESCRIPTION": {
                    "title": "Ci Runner Description",
                    "type": "string"
                },
                "CI_RUNNER_ID": {
                    "title": "Ci Runner Id",
                    "type": "string"
                },
                "CI_RUNNER_TAGS": {
                    "title": "Ci Runner Tags",
                    "type": "string"
                },
                "CI_PIPELINE_ID": {
                    "title": "Ci Pipeline Id",
                    "type": "string"
                },
                "CI_PROJECT_DIR": {
                    "title": "Ci Project Dir",
                    "type": "string"
                },
                "CI_PROJECT_ID": {
                    "title": "Ci Project Id",
                    "type": "string"
                },
                "CI_PROJECT_NAME": {
                    "title": "Ci Project Name",
                    "type": "string"
                },
                "CI_PROJECT_NAMESPACE": {
                    "title": "Ci Project Namespace",
                    "type": "string"
                },
                "CI_PROJECT_PATH": {
                    "title": "Ci Project Path",
                    "type": "string"
                },
                "CI_PROJECT_URL": {
                    "title": "Ci Project Url",
                    "type": "string"
                },
                "CI_REGISTRY": {
                    "title": "Ci Registry",
                    "type": "string"
                },
                "CI_REGISTRY_IMAGE": {
                    "title": "Ci Registry Image",
                    "type": "string"
                },
                "CI_REGISTRY_USER": {
                    "title": "Ci Registry User",
                    "type": "string"
                },
                "CI_SERVER": {
                    "title": "Ci Server",
                    "type": "string"
                },
                "CI_SERVER_NAME": {
                    "title": "Ci Server Name",
                    "type": "string"
                },
                "CI_SERVER_REVISION": {
                    "title": "Ci Server Revision",
                    "type": "string"
                },
                "CI_SERVER_VERSION": {
                    "title": "Ci Server Version",
                    "type": "string"
                },
                "GITLAB_CI": {
                    "title": "Gitlab Ci",
                    "type": "string"
                },
                "GITLAB_USER_ID": {
                    "title": "Gitlab User Id",
                    "type": "string"
                },
                "GITLAB_USER_EMAIL": {
                    "title": "Gitlab User Email",
                    "type": "string"
                }
            }
        },
        "Summary": {
            "title": "Summary",
            "type": "object",
            "properties": {
                "passed": {
                    "title": "Passed",
                    "type": "integer"
                },
                "total": {
                    "title": "Total",
                    "type": "integer"
                },
                "collected": {
                    "title": "Collected",
                    "type": "integer"
                }
            },
            "required": [
                "collected"
            ]
        },
        "ResultItem": {
            "title": "ResultItem",
            "type": "object",
            "properties": {
                "nodeid": {
                    "title": "Nodeid",
                    "type": "string"
                },
                "type": {
                    "title": "Type",
                    "type": "string"
                },
                "lineno": {
                    "title": "Lineno",
                    "type": "integer"
                }
            },
            "required": [
                "nodeid",
                "type"
            ]
        },
        "Collector": {
            "title": "Collector",
            "type": "object",
            "properties": {
                "nodeid": {
                    "title": "Nodeid",
                    "type": "string"
                },
                "outcome": {
                    "title": "Outcome",
                    "type": "string"
                },
                "result": {
                    "title": "Result",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/ResultItem"
                    }
                }
            },
            "required": [
                "nodeid",
                "outcome",
                "result"
            ]
        },
        "Setup": {
            "title": "Setup",
            "type": "object",
            "properties": {
                "duration": {
                    "title": "Duration",
                    "type": "number"
                },
                "outcome": {
                    "title": "Outcome",
                    "type": "string"
                }
            },
            "required": [
                "duration",
                "outcome"
            ]
        },
        "Call": {
            "title": "Call",
            "type": "object",
            "properties": {
                "duration": {
                    "title": "Duration",
                    "type": "number"
                },
                "outcome": {
                    "title": "Outcome",
                    "type": "string"
                }
            },
            "required": [
                "duration",
                "outcome"
            ]
        },
        "Teardown": {
            "title": "Teardown",
            "type": "object",
            "properties": {
                "duration": {
                    "title": "Duration",
                    "type": "number"
                },
                "outcome": {
                    "title": "Outcome",
                    "type": "string"
                }
            },
            "required": [
                "duration",
                "outcome"
            ]
        },
        "Test": {
            "title": "Test",
            "type": "object",
            "properties": {
                "nodeid": {
                    "title": "Nodeid",
                    "type": "string"
                },
                "lineno": {
                    "title": "Lineno",
                    "type": "integer"
                },
                "outcome": {
                    "title": "Outcome",
                    "type": "string"
                },
                "keywords": {
                    "title": "Keywords",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "setup": {
                    "$ref": "#/definitions/Setup"
                },
                "call": {
                    "$ref": "#/definitions/Call"
                },
                "teardown": {
                    "$ref": "#/definitions/Teardown"
                }
            },
            "required": [
                "nodeid",
                "lineno",
                "outcome",
                "keywords",
                "setup",
                "teardown"
            ]
        },
        "Warning": {
            "title": "Warning",
            "type": "object",
            "properties": {
                "message": {
                    "title": "Message",
                    "type": "string"
                },
                "category": {
                    "title": "Category",
                    "type": "string"
                },
                "when": {
                    "title": "When",
                    "type": "string"
                },
                "filename": {
                    "title": "Filename",
                    "type": "string"
                },
                "lineno": {
                    "title": "Lineno",
                    "type": "integer"
                }
            },
            "required": [
                "message",
                "category",
                "when",
                "filename",
                "lineno"
            ]
        }
    }
}

Pytest JUnit XML report

pytest-junit.xsd
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="failure">
        <xs:complexType mixed="true">
            <xs:attribute name="type" type="xs:string" use="optional"/>
            <xs:attribute name="message" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="error">
        <xs:complexType mixed="true">
            <xs:attribute name="type" type="xs:string" use="optional"/>
            <xs:attribute name="message" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="skipped">
        <xs:complexType>
            <xs:attribute name="message" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="properties">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="property" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="property">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="value" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="system-err" type="xs:string"/>
    <xs:element name="system-out" type="xs:string"/>
    <xs:element name="testcase">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="error" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="assertions" type="xs:string" use="optional"/>
            <xs:attribute name="time" type="xs:decimal" use="required"/>
            <xs:attribute name="classname" type="xs:string" use="optional"/>
            <xs:attribute name="status" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="testsuite">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="testcase" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
            <xs:attribute name="tests" type="xs:int" use="required"/>
            <xs:attribute name="failures" type="xs:int" use="required"/>
            <xs:attribute name="errors" type="xs:int" use="required"/>
            <xs:attribute name="skipped" type="xs:int" use="optional"/>
            <xs:attribute name="time" type="xs:decimal" use="required"/>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="timestamp" type="xs:dateTimeStamp" use="required"/>
            <xs:attribute name="hostname" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="testsuites">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>