RedHatQE / polarize

GNU General Public License v3.0
2 stars 2 forks source link

If using the linkedWorkItem field, if you only specify one item to link to, but have 2 project, both projects will associate to the linked work item #48

Open rarebreed opened 7 years ago

rarebreed commented 7 years ago

The problem is if you have two projectID, like RHEL6 and RedHatEnterpriseLinux7 but you only specify one item to link to, both projects will get linked. For example:

    @TestDefinition( projectID={Project.RHEL6, Project.RedHatEnterpriseLinux7}
                    , testCaseID = {"RHEL6-47815", "RHEL7-88467"}
                    , importance= DefTypes.Importance.MEDIUM
            , tags="tier1 polarize"
            , testtype = @TestType( testtype = DefTypes.TestTypes.FUNCTIONAL
                                          , subtype1 = DefTypes.Subtypes.RELIABILITY
                                          , subtype2 = DefTypes.Subtypes.EMPTY)
            , linkedWorkItems={@LinkedItem( workitemId="RHEL6-26658"
                                          , project=Project.RHEL6
                                          , role=DefTypes.Role.VERIFIES)}
            , update=true)
    @Test(description="Polarion video training",
          groups={"polarize"})
        public void polarizeTraining3_Test() {

    }

In this example, we only want to link to the RHEL6 project, as our workitemId is RHEL6-26658. But, when we look at the XML generated by this annotation, we see that the XML description for the RedHatEnterpriseLinux7 project also gets it:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testcases project-id="RedHatEnterpriseLinux7">
    <response-properties>
        <response-property name="rhsm_qe" value="testcase_importer"/>
    </response-properties>
    <testcase id="RHEL7-88467">
        <title>RHSM-TC : rhsm.cli.tests.ActivationKeyTests.polarizeTraining3_Test</title>
        <description>Polarion video training</description>
        <test-steps>
            <test-step>
                <test-step-column id="step"/>
            </test-step>
        </test-steps>
        <custom-fields>
            <custom-field id="caseautomation" content="automated"/>
            <custom-field id="caseimportance" content="medium"/>
            <custom-field id="caselevel" content="system"/>
            <custom-field id="caseposneg" content="positive"/>
            <custom-field id="tags" content="tier1 polarize"/>
            <custom-field id="testtype" content="functional"/>
            <custom-field id="subtype1" content="reliability"/>
            <custom-field id="subtype2" content="-"/>
        </custom-fields>
        <linked-work-items>
            <linked-work-item workitem-id="RHEL6-26658" role-id="VERIFIES"/>
        </linked-work-items>
    </testcase>
</testcases>

So when processing the TestDefinition annotation, when we store it in the Meta we need to line them up like we do with projectID-testcaseID