telekom / testerra-xray-connector

testerra-xray-connector is used for synchronizing test results with Xray plugin for Atlassian Jira.
Apache License 2.0
4 stars 1 forks source link

DefaultSummaryMapper overrides/deletes content of existing test cases #16

Closed sbke-mms closed 1 year ago

sbke-mms commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce

  1. Annotate a test case with @XrayTest(key="ABC-123")
  2. Use the DefaultSummaryMapper
  3. Start a test run

Expected behavior Only an execution with results for test ABC-123 gets created.

Observed behavior Test ABC-123 gets renamed with name of the test in the code and the steps of the test get deleted.

Test

public class XrayResultSynchronizer extends AbstractXrayResultsSynchronizer implements PropertyManagerProvider {
    public XrayMapper getXrayMapper() {
        return new DefaultSummaryMapper();
    }
}

example test:

@XrayTest(key="TEST-123") //use a ticket id of an existing xray test case
@Test
public void newTestName(){ //newTestName should be different from any existing test case (not sure what would happen if it's the same as an existing one that isn't TEST-123
    //do whatever here
}
sbke-mms commented 2 years ago

A quickfix might be to not sync at all if both the @XrayTest annotation and the DefaultSummaryMapper and generate some kind of warning/error that they don't work together.

sbke-mms commented 2 years ago

accidentally closed

sbke-mms commented 2 years ago

Additional info from review of the bug (already known in https://github.com/telekom/testerra-xray-connector/pull/17): The override isn't depending on the DefaultSummaryMapper. The steps in Xray get overwritten independent of the mapper.