Skip to content

Commit

Permalink
[ci] add urg assertion report detail section in summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Oct 9, 2024
1 parent 002dcfa commit 6a43ef2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nix/t1/run/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ let
cp -vr $emuOutput $out
chmod -R u+w $out
${vcs-emu.vcs-fhs-env}/bin/vcs-fhs-env -c "urg -dir $emuOutput/*/cm.vdb -format text"
${vcs-emu.vcs-fhs-env}/bin/vcs-fhs-env -c "urg -dir $emuOutput/*/cm.vdb -format text -metric assert -show summary"
cp -vr urgReport $out/
'';
in
Expand Down
16 changes: 12 additions & 4 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ object Main:
"## Cycle Update\n"
)

if urgReportFilePath.nonEmpty then
os.write(os.Path(urgReportFilePath.get, os.pwd), "# Coverage report\n")
if urgReportFilePath.nonEmpty then os.write(os.Path(urgReportFilePath.get, os.pwd), "# Coverage report\n")

os.walk(os.pwd / ".github" / caseDir)
.filter(_.last == "default.json")
Expand Down Expand Up @@ -292,17 +291,26 @@ object Main:
Logger.info("Filtering urg report")
val finalMdPath = os.Path(urgReportFilePath.get, os.pwd)
val urgAssertFile = emuResultPath / "urgReport" / "asserts.txt"
val heading = "^Summary for Cover Properties$".r
val summaryHeading = "^Summary for Cover Properties$".r
val coverSummaryStr =
os.read(urgAssertFile)
.lines()
.dropWhile(!heading.matches(_))
.dropWhile(!summaryHeading.matches(_))
.takeWhile(_.distinct != "-")
.toArray
.mkString("\n")
val detailHeading = "^Detail Report for Cover Properties$".r
val coverDetailStr =
os.read(urgAssertFile)
.lines()
.dropWhile(!detailHeading.matches(_))
.toArray
.mkString("\n")
os.write.append(finalMdPath, s"### Coverage for $config \n")
os.write.append(finalMdPath, "```text\n")
os.write.append(finalMdPath, coverSummaryStr)
os.write.append(finalMdPath, "----------------------\n")
os.write.append(finalMdPath, coverDetailStr)
os.write.append(finalMdPath, "\n```\n")

os.write.over(file, ujson.write(cycleRecord, indent = 2))
Expand Down

0 comments on commit 6a43ef2

Please sign in to comment.