rerunner-jupiter | Junit 5. Re-run failed JUnit tests immediately | Testing library
kandi X-RAY | rerunner-jupiter Summary
kandi X-RAY | rerunner-jupiter Summary
Extension for Junit 5. Re-run failed JUnit tests immediately.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generate the test template invocation context
- Returns the store for the test extension
- Creates the name formatter for parameterizedIfExceptions test case
- Checks if the test is annotated against the given extension
- Returns true if the method has a valid signature
- Replies if the given parameter is an aggregator
- Called when a test execution exception is reached
- Determines whether an exception is thrown
- Check if the history is reachable
- This method determines whether the test should be performed
- Returns true if a non repeatable exception occured
- Provide the execution context for the test template invocation
- Handler for display name display name
- Factory method for parameter resolution exception
- Add an exception to the history
- Returns the display name of the current execution
- Gets additional extensions
- Resolves the given parameter
- Returns the index of first aggregator
- Checks whether the test method is annotated
- Provides a stream of Arguments
- Called before test is executed
- Creates a new ArgumentsProvider instance
- Check if there are exceptions in the test
- Returns an array of arguments that can be consumed by the given method
- Check if extension should be executed
rerunner-jupiter Key Features
rerunner-jupiter Examples and Code Snippets
Community Discussions
Trending Discussions on rerunner-jupiter
QUESTION
I have set of JUnit5 tests which are run and reported with gradle by Jenkins. Some of them are unstable without my control (let's say "internal server error" from external service) and in random way. I can re-run them with gradle "test retry" plugin or by some other way but then initial failures are present in test summary and build is reported as unstable in Jenkins. But the need is to have "Success" build if failed tests are good after second try. Therefore does anybody know the way to re-run tests without reporting of initial failure in test results?
My current idea is to try the following:
- hide specific exceptions with TestExecutionExceptionHandler to have initial failure reported as success
- implement @TestFactory to return failed tests dynamically for second run
- implement ClassOrderer to run mentioned test factory as the last test and other complications. So looks pretty ugly. Therefore hope for existing of better solution.
Update: Tried to use https://github.com/artsok/rerunner-jupiter library. Since I don't want to replace @Test annotations with custom @ReplaceIfExceptions... for all test methods in the project, I tried to override ...Extension class of the library and use it with "@ExtendWith" at class level of some basic test class. Then understood that replacing of @Test with @TestTemplate at method level is still needed for this approach to work. Therefore now I'm thinking about replacing of @Test with some my custom annotation to have ability quickly add to it anything like @ReplaceIfExceptions... or @TestTemplate or whatever would be needed.
...ANSWER
Answered 2021-Sep-27 at 14:37Finally I used https://github.com/artsok/rerunner-jupiter library. It throws TestAbortedException before repetition of failed test and such failure is marked as ignored test. The result of build is marked as successful in this case. It was needed to replace @Test annotation to my custom annotation and add @TestTemplate to it, also I extended from Extension class of the library and applied my implementation of extension to class of my basic test using @ExtendWith. Looks like the only way to use the library without using of @ReplaceIfExceptions... annotation on each test method.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rerunner-jupiter
You can use rerunner-jupiter like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the rerunner-jupiter component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page