Skip to content

Commit

Permalink
[ci] fix VCS CI report
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Jul 31, 2024
1 parent c6e311f commit f427490
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit f427490

Please sign in to comment.