Skip to content

Commit

Permalink
Update test logging configuration to capture output in test-output.log
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed May 22, 2024
1 parent 6072716 commit b1b91a2
Showing 1 changed file with 15 additions and 57 deletions.
72 changes: 15 additions & 57 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -314,68 +314,26 @@ allprojects {
* This property additionally keeps the log files of successful tests.
*
*/
// additional configuration for detailed test logging
def logDir = new File("${buildDir}/test-logs")
if (!logDir.exists()) {
logDir.mkdirs()
println "Created test-logs directory: ${logDir.absolutePath}"
} else {
println "test-logs directory already exists: ${logDir.absolutePath}"
}
def logFile = new File(logDir, "test-output.log")
def outputStream = new FileOutputStream(logFile, true) // Append to the file
def printStream = new PrintStream(outputStream)
println "Created test-output.log file: ${logFile.absolutePath}"

test {
jvmArgs += [
'-Xmx4g',
'-XX:-UseGCOverheadLimit',
// Mockito and jackson-databind do some strange reflection during tests.
// This suppresses an illegal access warning.
'--add-opens',
'java.base/java.util=ALL-UNNAMED',
'--add-opens',
'java.base/java.util.concurrent=ALL-UNNAMED',
'--add-opens',
'java.base/java.util.concurrent.atomic=ALL-UNNAMED',
// errorprone tests need access to the javac compiler
'--add-exports',
'jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports',
'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
]
Set toImport = [
'test.ethereum.include',
'test.ethereum.state.eip',
'root.log.level',
'evm.log.level',
'acctests.keepLogsOfPassingTests'
]
for (String name : toImport) {
if (System.getProperty(name) != null) {
systemProperty name, System.getProperty(name)
}
}
useJUnitPlatform {}
// additional configuration for detailed test logging
def logDir = new File("${buildDir}/test-logs")
if (!logDir.exists()) {
logDir.mkdirs()
println "Created test-logs directory: ${logDir.absolutePath}"
} else {
println "test-logs directory already exists: ${logDir.absolutePath}"
}
def logFile = new File(logDir, "test-output.log")
def outputStream = new FileOutputStream(logFile, true) // Append to the file
def printStream = new PrintStream(outputStream)
println "Created test-output.log file: ${logFile.absolutePath}"
standardOutput = printStream
standardError = printStream
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
events "passed", "skipped", "failed"
// Set the standard output and error streams to the printStream
standardOutput = printStream
standardError = printStream
}
outputs.upToDateWhen { false }
}
Expand Down

0 comments on commit b1b91a2

Please sign in to comment.