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

report transient retry failures #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bencsr
Copy link

@bencsr bencsr commented Dec 7, 2024

Hi!

I use jest to run integration tests, and publish the output of jest-junit to Azure DevOps, and use the Test Analytics feature to monitor test execution.

I'd like to use jest.retryTimes to retry flaky test cases. But it would be really great to keep track of the transient failures as well. That's why I created an option, to put the transient failures also to the report.

Related to #157

In this example jest.retryTimes(5) was used, and the first two invocations were failing, and the third invocation succeeded.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="tests" tests="1" failures="0" errors="0" time="17.456">
  <testsuite name="Suite 1" errors="0" failures="0" skipped="0" timestamp="2024-12-06T15:41:18" time="16.788" tests="1">
    <testcase classname="fooo bar" name="fooo bar" time="0.324">
      <failure>Error: expect(received).toBeFalsy()</failure>
    </testcase>
    <testcase classname="fooo bar" name="fooo bar" time="0.324">
      <failure>Error: expect(received).toBeFalsy()</failure>
    </testcase>
    <testcase classname="fooo bar" name="fooo bar" time="0.324">
    </testcase>
  </testsuite>
</testsuites>

@palmerj3
Copy link
Collaborator

palmerj3 commented Dec 7, 2024

This change looks good to me. Thanks! Seems like a reasonable way to handle this case and I like that it's opt-in.

I need to do some debugging on jest-junit's CI setup since it is failing as of recent. So I may need some time to fix that before I can merge this.

@bencsr
Copy link
Author

bencsr commented Dec 8, 2024

@palmerj3 I also had issues locally when installing the dependencies, I think libxmljs2 was the culprit for me as well.
I switched back to Node 16 on my machine

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

Successfully merging this pull request may close these issues.

2 participants