Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import of jUnit does not keep order of testcases #195

Open
janholusa opened this issue Jan 8, 2024 · 1 comment
Open

import of jUnit does not keep order of testcases #195

janholusa opened this issue Jan 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@janholusa
Copy link

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

  • 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>
  • how it looks in testrail(note the order):
    order-sample

Interested in implementing it yourself?

No

@janholusa janholusa added the enhancement New feature or request label Jan 8, 2024
@Testinator-X
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants