mkoura / dump2polarion

Dump data to Polarion® Importers
GNU General Public License v2.0
14 stars 7 forks source link

BLOCKED testcases are not getting uploaded by polarion_dumper.py #8

Closed Yadnyawalkya closed 5 years ago

Yadnyawalkya commented 5 years ago

Let say we have exported following csv and added verdict PASSED, FAILED and BLOCKED.

Exported on 2018-12-23 09:30
Query   (assignee.id:(ytale) AND title:OSP AND NOT status:inactive AND (TEST_RECORDS:("RHCF3/5_10_0_30",@null))) AND project.id:RHCF3

ID          Title                               Verdict
RHCF3-51011 OSP: Test DS and Volume availiblity in source and target    PASSED
RHCF3-51013 OSP: Test delete infra mapping                  FAILED
RHCF3-51028 OSP: Test edit migration plan                   BLOCKED

With command, polarion_dumper.py -i 'workitems.csv' -c ~/.config/polarion_tools.yaml

it only upload PASSED and FAILED results and does not upload BLOCKED results.

Import logs says,

xUnit Import Log for job #362914
Download
2018-12-24 13:43:47,416 INFO ImportXUnitThread_15018 - Red Hat Importers version 2.0.21.
2018-12-24 13:43:47,416 INFO ImportXUnitThread_15018 - Processing job #362914.
2018-12-24 13:43:47,416 INFO ImportXUnitThread_15018 - Running as 'Import User'.
2018-12-24 13:43:47,416 INFO ImportXUnitThread_15018 - Starting import of XUnit results to Polarion.
2018-12-24 13:43:47,417 INFO ImportXUnitThread_15018 - Deserializing XUnit results.
2018-12-24 13:43:52,643 INFO ImportXUnitThread_15018 - Using Polarion lookup method: name
2018-12-24 13:43:52,771 INFO ImportXUnitThread_15018 - Importing results to test run '5_10_0_30'.
2018-12-24 13:43:52,771 INFO ImportXUnitThread_15018 - Processing test suite 'Import for RHCF3 - 5_10_0_30 testrun'.
2018-12-24 13:43:52,771 INFO ImportXUnitThread_15018 - Processing test case 'OSP: Test DS and Volume availiblity in source and target'.
2018-12-24 13:43:52,850 INFO ImportXUnitThread_15018 - Work item: 'OSP: Test DS and Volume availiblity in source and target' (RHCF3-51011)
2018-12-24 13:43:53,031 INFO ImportXUnitThread_15018 - Processing test case 'OSP: Test delete infra mapping'.
2018-12-24 13:43:53,107 INFO ImportXUnitThread_15018 - Work item: 'OSP: Test delete infra mapping' (RHCF3-51013)
2018-12-24 13:43:56,510 INFO ImportXUnitThread_15018 - Test suite 'Import for RHCF3 - 5_10_0_30 testrun' contains 3 test cases.
2018-12-24 13:43:59,016 INFO ImportXUnitThread_15018 - Polarion results published to: https://hostname/polarion/#/project/RHCF3/testrun?id=5_10_0_30
2018-12-24 13:43:59,016 INFO ImportXUnitThread_15018 - Ending import of XUnit results to Polarion.
2018-12-24 13:43:59,016 INFO ImportXUnitThread_15018 - Sending message to the UMB.
2018-12-24 13:43:59,623 INFO ImportXUnitThread_15018 - Sending import message:
Message Headers:
  JMSDestination: null
  JMSDeliveryMode: non-persistent
  JMSExpiration: 0
  JMSPriority: 0
  JMSMessageID: null
  JMSTimestamp: 0
  JMSCorrelationID: null
  JMSReplyTo: null
  JMSRedelivered: false
  JMSType: application/json
Message Properties:
  job-id: 362914
  type: import-results
Message Content:
{
  "testrun-url" : "https://hostname/polarion/#/project/RHCF3/testrun?id=5_10_0_30",
  "import-results" : [ {
    "suite-name" : "Import for RHCF3 - 5_10_0_30 testrun",
    "status" : "passed"
  } ],
  "status" : "passed",
  "log-url" : "https://hostname/polarion/rh-import/xunit-log?jobId=362914"
}
2018-12-24 13:43:59,740 INFO ImportXUnitThread_15018 - Message sent.

Issue found in - dump2polarion v0.33 Expected - polarion_dumper.py should upload blocked testcases.

mkoura commented 5 years ago

This is intended behavior in CFME, only passed results and skips with blocker (GH issue, bugzilla number, etc.) are reported. If you want to report skip (blocked) result, make sure you have a "comment" column in your CSV file and the particular result has a comment that matches this regular expression - https://github.com/mkoura/dump2polarion/blob/master/dump2polarion/transform.py#L158-L162

Are you sure the fail result was really marked as failed in the CSV? Failed results are not reported unless there is a "FAILME" string in comment (see https://github.com/mkoura/dump2polarion/blob/master/dump2polarion/transform.py#L243)

The reason for importing only passed results and blocked results with existing blocker by default is that we don't want to have failures caused by networking, infrastructure, outdated tests etc. imported into polarion.

Yadnyawalkya commented 5 years ago

Thanks for explanation @mkoura, I did added Comment section and checked but it did not matched mentioned regular expression thats why may be it wasn't uploaded. (I was writing something like infra not present in Comments which was not correct)

And on FAILED verdicts, above was just an example, I always use FAILME there.