asam-ev / qc-framework

Mozilla Public License 2.0
15 stars 8 forks source link

Add rule uid to result xsd #72

Closed romanodanilo closed 4 months ago

romanodanilo commented 4 months ago

Description

Add AddressedRule and metadata attribute to result xsd schema

From #25 , 2 out of 4 requested fields are implemented:

The remaining two fields should be already integrated in ruleUID naming conventions as indicated in #22

Addressed Rule:

  <xs:element name="AddressedRule" type="RuleType" minOccurs="0" maxOccurs="unbounded" />
      ...
<xs:complexType name="RuleType">
    <xs:attribute name="ruleUID" type="xs:string" />
  </xs:complexType>

Metadata:

      <xs:element name="Metadata" type="MetadataType" minOccurs="0" maxOccurs="unbounded" />
...
 <xs:complexType name="MetadataType">
    <xs:attribute name="key" type="xs:string" />
    <xs:attribute name="value" type="xs:string" />
    <xs:attribute name="description" type="xs:string" />
  </xs:complexType>

How was the PR tested?

  1. Unit-test. All unit tests passed.

Example test result with all the new fields:

Beginning of XML file: 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<CheckerResults version="1.0.0">

  <CheckerBundle build_date="" description="" name="DemoCheckerBundle" summary="Found 2 issues" version="">
    <Checker checkerId="exampleChecker" description="This is a description" summary="">
      <Issue description="This is an information from the demo usecase" issueId="0" level="3"/>
    </Checker>
    <Checker checkerId="exampleInertialChecker" description="This is a description of inertial checker" summary="">
      <Issue description="This is an information from the demo usecase" issueId="1" level="3">
        <Locations description="inertial position">
          <InertialLocation x="1.000000" y="2.000000" z="3.000000"/>
        </Locations>
      </Issue>
    </Checker>
    <Checker checkerId="exampleRuleUIDChecker" description="This is a description of ruleUID checker" summary="">
      <AddressedRule ruleUID="test.com::qwerty.qwerty"/>
      <Metadata description="Date in which the checker was executed" key="run date" value="2024/06/06"/>
      <Metadata description="Name of the project that created the checker" key="reference project" value="project01"/>
    </Checker>
  </CheckerBundle>

</CheckerResults>

Notes

Addresses #22 #25