- Some Jenkins plugins, like the Flaky Test Handler Plugin, can automatically retry failed tests a certain number of times, but they don't offer manual selection and rerun of failed tests from the UI.
- You can script your Jenkins Pipeline to run tests, identify failed ones, and rerun them. This involves catching exceptions from the initial test run, parsing test results to find failures, and executing a rerun command for the failed tests.
- Using external scripts (e.g., Python or Bash) to parse test results and identify failed tests allows more flexibility. These scripts can then rerun only the failed tests, integrating this process into Jenkins jobs either in a Pipeline step or as a build step in a freestyle project.
How to rerun failed test cases in Jenkins build
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
When we run unit test cases using 'run' in MATLAB, the failed test cases can be rerun using the hyperlink in results:
1 Passed, 1 Failed (rerun), 0 Incomplete.
Is there any similar option to run only the failed test cases in Jenkins. Or if we can store the "failedTests = suite([results.Failed]);" in results and then rerun them in Jenkins build.
0 Kommentare
Antworten (1)
Pratyush
am 16 Apr. 2024
Hi Pooja,
In Jenkins, there isn't a built-in feature like MATLAB's for rerunning only failed tests directly from the UI. However, you can achieve a similar outcome by using Jenkins plugins, scripting in Jenkins Pipeline, or employing external scripts:
Each method requires some setup and configuration, such as handling the logic for identifying and rerunning failed tests and integrating test result parsing and rerun commands into your Jenkins workflow.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Testing Frameworks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!