-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Polish OutputCapture and its JUnit Jupiter extension #17049
Polish OutputCapture and its JUnit Jupiter extension #17049
Conversation
This commit refactors OutputCaptureExtension so that state is stored in the ExtensionContext.Store instead of in the extension. This is more idiomatic for JUnit Jupiter extensions and allows for potential concurrent use of the extension.
This commit introduces failing tests for the OutputCaptureExtension, which are currently @disabled.
Thanks, @sbrannen. This is quite timely as I had just come to the realisation that storing the |
Sure. No problem. FWIW, I already did a spike for parallel execution support by storing Perhaps you have an idea of how to solve that. If not, you might consider the implementation in the JUnit Platform for inspiration. |
It might be possible to support output capture during parallel test execution using |
...oject/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCapture.java
Show resolved
Hide resolved
I'm not sure we should support parallel execution for now. We probably ought to just wait until we hit the need for it ourselves. |
I can certainly understand that. In my opinion, it's only a "nice to have" feature. So, if the community doesn't really request/need it, then postponing any work on it is justified. I still think it would be worth it to document that fact in the Javadoc and Boot reference docs. |
- Polish Javadoc - Improve error message in OutputCapture - Use ExtensionContext.Store in OutputCaptureExtension See gh-17049
Thanks very much, @sbrannen. |
This PR contains a number of individual commits to improve the output capture extensions for JUnit 4 and JUnit Jupiter.
Commit 490e315 is not essential, but the changes will likely be necessary to support parallel test execution. The subsequent commit (8ce1237) introduces a failing, disabled test case which demonstrates that parallel execution is currently not supported. If the team decides not to support parallel test execution, I recommend that a note be added to the Javadoc and Reference Manual to document this known shortcoming.