gurock / trcli

TR CLI (trcli) is a command line tool for interacting with TestRail.
Mozilla Public License 2.0
48 stars 39 forks source link

import of jUnit does not keep order of testcases #195

Open janholusa opened 5 months ago

janholusa commented 5 months ago

What would you like the TestRail CLI to be able to do?

Add parameter which will be responsible for keeping order of testcases as they are in the test suite. (and pay for it with longer import time)

Why is this feature necessary on the TestRail CLI?

Sometimes logic is that TCs are depended on order - in this case testrail is useless in term of investigation - it is only good for statistics (where one failed is still one failed not depended on order)

Some tools allows slightly different logic - that testsuite is actually bunch of testcases, and each TC consist of some atomic steps. But whole testsuite checks some complex functionality with setups on the start, some tests in the middle, teardowns at the end... In this case it is also necessary to keep order of steps/TCs (setup TCs must be first, teardown TCs last...)

More details

Sample of input xml and how it looks when it is imported using this command ./trcli/bin/trcli -y -h https://instance.testrail.io/ --project "Autotest" --username USERNAME --password APIKEY parse_junit --title "import-test-order-sample" -f testrail-order-sample.xml

<testsuites name="Autotest test" time="1882.579">

 <testsuite name="9 Setup: Setup Device Context" time="13.934" tests="5" failures="0" errors="0" skipped="0" file="SetupDeviceContext.php">
    <testcase name="53" classname="a" time="10.358" file="/SetupDeviceContext.php" line="27">
      <properties>
        <property name="testrail_result_field" value="status_id:1"/>
      </properties>
    </testcase>
    <testcase name="54" classname="b" time="0" file="SetupDeviceContext.php" line="45">
      <properties>
        <property name="testrail_result_field" value="status_id:1"/>
      </properties>
    </testcase>
    <testcase name="55" classname="c" time="3.028" file="SetupDeviceContext.php" line="53">
      <properties>
        <property name="testrail_result_field" value="status_id:1"/>
      </properties>
    </testcase>
    <testcase name="56" classname="d" time="0.418" file="SetupDeviceContext.php" line="65">
      <properties>
        <property name="testrail_result_field" value="status_id:1"/>
      </properties>
    </testcase>
    <testcase name="57" classname="e" time="0.102" file="SetupDeviceContext.php" line="76">
      <properties>
        <property name="testrail_result_field" value="status_id:1"/>
      </properties>
    </testcase>
  </testsuite>
</testsuites>

Interested in implementing it yourself?

No

Testinator-X commented 5 months ago

Maybe disabling multithreading while importing / adding results helps? For more details see: https://github.com/gurock/trcli?tab=readme-ov-file#multithreading šŸ¤”