From f427490c2d0506eb95208994d839c6708c1eed98 Mon Sep 17 00:00:00 2001 From: Avimitin Date: Wed, 31 Jul 2024 16:40:37 +0800 Subject: [PATCH] [ci] fix VCS CI report Signed-off-by: Avimitin --- script/ci/src/Main.scala | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index 1f473ad32d..8564ce6b2c 100644 --- a/script/ci/src/Main.scala +++ b/script/ci/src/Main.scala @@ -157,7 +157,7 @@ object Main: val Array(config, caseName) = testName.split(",") println("\n") Logger.info( - s"${BOLD}[${index + 1}/${allJobs.length}]${RESET} Running VCS for test case $caseName with config $config" + s"${BOLD}[${index + 1}/${allJobs.length}]${RESET} Simulating test case $caseName with config $config" ) val testAttr = testType.toLowerCase() match @@ -175,7 +175,7 @@ object Main: ) catch case _ => - Logger.error(s"emulation for config $config, case $caseName fail") + Logger.error(s"Emulation for config $config, case $caseName fail") println("-" * 50) println(os.proc("nix", "log", testAttr).call().out) println("-" * 50) @@ -185,9 +185,11 @@ object Main: val testSuccess = os.read(testResultPath / "offline-check-status").trim() == "0" if !testSuccess then - Logger.error(s"Offline check for $caseName ($config) failed") + Logger.error(s"Offline check FAILED for $caseName ($config)") allFailedTest :+ s"t1.$config.cases.$caseName" - else allFailedTest + else + Logger.info(s"Offline check PASS for $caseName ($config)") + allFailedTest end findFailedTests val failedTests = findFailedTests() @@ -243,7 +245,10 @@ object Main: name = "cycle-update-file-path", doc = "specify the cycle update markdown file output path" ) cycleUpdateFilePath: Option[String], - emuType: String = "verilator" + @arg( + name = "emu-type", + doc = "Specify emulation type" + ) emuType: String = "verilator" ) = val failedTestsFile = os.Path(failedTestsFilePath, os.pwd) os.write.over(failedTestsFile, "## Failed Tests\n") @@ -266,8 +271,12 @@ object Main: s".#t1.$config.cases._allEmuResult" case "vcs" => s".#t1.$config.cases._allVCSEmuResult" case _ => Logger.fatal(s"Invalid test type ${emuType}") - val emuResultPath = - os.Path(nixResolvePath(s".#t1.$config.cases._allEmuResult")) + val emuResultPath = os.Path(nixResolvePath( + resultAttr, + if emuType.toLowerCase() == "vcs" then + Seq("--impure") + else Seq() + )) Logger.info("Collecting failed tests") os.walk(emuResultPath)