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

Use time in suite if provided #49

Open
rohit-gohri opened this issue Mar 2, 2023 · 0 comments
Open

Use time in suite if provided #49

rohit-gohri opened this issue Mar 2, 2023 · 0 comments

Comments

@rohit-gohri
Copy link

I have a junit xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="client" tests="72" failures="0" errors="0" time="2.176">
  <testsuite name="src/__tests__/1.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-01T22:51:14" time="1.56" tests="7">
    <testcase classname="1 hook" name="should set a" time="0.029">
    </testcase>
    <testcase classname="1 hook" name="should set b" time="0.006">
    </testcase>
    <testcase classname="1 hook" name="should set c" time="0.005">
    </testcase>
    <testcase classname="1 hook" name="should set d" time="0.004">
    </testcase>
    <testcase classname="1 hook" name="should set e" time="0.007">
    </testcase>
    <testcase classname="1 hook" name="should set f" time="0.003">
    </testcase>
    <testcase classname="1 hook" name="should set g" time="0.01">
    </testcase>
  </testsuite>
  <testsuite name="src/__tests__/2.test.tsx" errors="0" failures="0" skipped="0" timestamp="2023-03-01T22:51:14" time="1.623" tests="6">
    <testcase classname="2" name="should set a" time="0.051">
    </testcase>
    <testcase classname="2" name="should set b" time="0.005">
    </testcase>
    <testcase classname="2" name="should set c" time="0.009">
    </testcase>
    <testcase classname="2" name="should set d" time="0.014">
    </testcase>
    <testcase classname="2" name="should set e" time="0.015">
    </testcase>
    <testcase classname="2" name="should set f" time="0.004">
    </testcase>
  </testsuite>
</testsuites>

(this is from the output of https://www.npmjs.com/package/jest-junit)

Expected

I expect the suites' totals.duration to match the time mentioned in the testsuite itself rather than be the sum of times in testcases.

Actual

The totals.duration is the sum of the testcases. This leaves out the time spent by the testsuite in setup and teardown which is not part of any 1 individual test case.

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

No branches or pull requests

1 participant