add proper logging to junit runs (#35394)
Basically, Junit is not logging any thing about its progress outside of the console. This is aimed at fixing that by outputing progress logs along with the standard logs. So there's going to be a line before each step of a test run, and a line after with the elapsed time. Also, exception are now part of the logs instead of being only part of the junit report. In the process of doing that, I decided to clean up and simplify the log4j2.xml file. I also noted a few issues with ANSI coloring, so there's a fix for that. Finally, I'm removing empty lines from container logs (MSSQL is full of them). The junit printing is done through an intereceptor. That interceptor uses introspection. I wanted to use a factory method, but java's ServiceLoader only allows classes that extends the service interface, hence the need to override every method in the interceptor class, and to plop a proxy on top of that.
This commit is contained in:
@@ -104,6 +104,7 @@ allprojects {
|
||||
systemProperty 'junit.jupiter.execution.parallel.config.fixed.parallelism', 1
|
||||
// Order test classes by annotation.
|
||||
systemProperty 'junit.jupiter.testclass.order.default', 'org.junit.jupiter.api.ClassOrderer$OrderAnnotation'
|
||||
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
|
||||
|
||||
if (!project.hasProperty('testExecutionConcurrency')) {
|
||||
// By default, let gradle spawn as many independent workers as it wants.
|
||||
|
||||
Reference in New Issue
Block a user