-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature/generate report on interruption #397
Feature/generate report on interruption #397
Conversation
…teJUnitXML2ReportListener;
registered JVMExitHook as new shutdownHook in Testerra; removed deprecated Code in TesterraListener; added log message in ExecutionEndListener:
The information that a test is crashed is never used. We should add a notice to the report. I think we can add something like that in if (contextController.getExecutionContext().isCrashed()) {
log().warn("Test execution was aborted. Test results may be imcomplete.", Loggable.prompt);
} |
core/src/main/java/eu/tsystems/mms/tic/testframework/common/JVMExitHook.java
Show resolved
Hide resolved
added log message in case of execution abortion in ExecutionEndListener;
As discussed please add a short note in documentation about this helpful feature. |
added paragraph on aborted execution in overview.adoc; added screenshots report-ng-23.png, report-ng-24.png, report-ng-25.png; removed jvm-monitor section in execution.adoc; included new JVM section in index.adoc; updated jvm-monitor.adoc; added reference to ExecutionAbortionEvent
…cated section aborted-execution.adoc; added new include in reports.adoc;
docs/src/docs/jvm/jvm-exit-hook.adoc
Outdated
The `JVMExitHook` was integrated to achieve the generation of a report with Report-NG in case an <<#ExecutionAbortion, aborted test run>>. With the start of a test execution the `JVMExitHook` is added as a shutdown hook to the JVM. | ||
|
||
When the JVM is about to stop, shutdown hooks are always called by default. This includes cases of abortion, all other system errors and normal finish. In the latter case a flag indicating an already created report is set true once in the process of the report generation. | ||
To avoid overriding the already existing report, the `JVMExitHook` only triggers when this flag is false, as this is the only indicator of an unexpected exit and a missing report. It then sends the <<#ExecutionAbortEvent, ExecutionAbortEvent>>, which is then caught by the corresponding listeners creating a report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your link to ExecutionAbortEvent
does not work anymore because it's an own chapter now. ;-)
coorrect reference to link of abortion event in jvm-exit-hook.adoc;
Description
Added mechanism to generate a report in case of unexpected abortion of test execution.
A ShutDownHook triggers on JVM finish in successful and failure cases. Report generation is then triggered within the Hook, if no report has been generated before. with sending a ExecutionAbortEvent.
Flag for generated report is set once only in ExecutionEndListener, in case of successful end of test execution (ExecutionFinishEvent received by the mentioned Listener).
Type of change
Checklist: