From 91b98b5ed2e3029b4113083fec4b5bc5a378edee Mon Sep 17 00:00:00 2001 From: Avimitin Date: Fri, 24 May 2024 01:31:13 +0800 Subject: [PATCH] [ci] add detail error detection Signed-off-by: Avimitin --- script/src/Main.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/src/Main.scala b/script/src/Main.scala index 13c0a45ff..a1daf7cc2 100644 --- a/script/src/Main.scala +++ b/script/src/Main.scala @@ -563,6 +563,7 @@ object Main: err => val outDir = testRunDir / config / caseName Logger.error(s"Test case $testName failed") + Logger.error(s"Detail error: $err") allFailedTest :+ testName os.write.over( @@ -576,8 +577,11 @@ object Main: os.write.over(actualResultDir / "failed-tests.md", listOfFailJobs) val failedJobsWithError = failed .map(testName => - s"* $testName\n >>> ERROR SUMMARY <<<\n${os - .read(actualResultDir / "failed-logs" / s"${testName.replaceAll(",", "-")}.txt")}" + val failLogPath = actualResultDir / "failed-logs" / s"${testName.replaceAll(",", "-")}.txt" + if os.exists(failLogPath) then + s"* $testName\n >>> ERROR SUMMARY <<<\n${os.read(failLogPath)}" + else + s"* $testName\nNo error log found, error may not been caught in previous steps" ) .appended("") .mkString("\n")