Skip to content

Commit

Permalink
[ci] move failed test report to each bucket
Browse files Browse the repository at this point in the history
Report CI result at final step might fail when RTL changes causing
online driver to fail. And developers might find it hard to get a list
of fail tests list to get fixed. This commit move the report step at
running stage.

Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Nov 11, 2024
1 parent 571b2ab commit d1e9a53
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 29 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/t1rocket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,11 @@ jobs:
nix run ".#ci-helper" -- postCI \
--urg-report-file-path ./urg-report.md \
--cycle-update-file-path ./cycle-update.md \
--failed-tests-file-path ./failed-tests.md \
--emu-lib "vcs" \
--top ${{ env.EMU_TOP }}
cat ./urg-report.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./cycle-update.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./failed-tests.md >> $GITHUB_STEP_SUMMARY
- name: "Commit cycle updates"
run: |
git config user.name github-actions
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/vcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,11 @@ jobs:
nix run ".#ci-helper" -- postCI \
--urg-report-file-path ./urg-report.md \
--cycle-update-file-path ./cycle-update.md \
--failed-tests-file-path ./failed-tests.md \
--emu-lib "vcs" \
--top ${{ env.EMU_TOP }}
cat ./urg-report.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./cycle-update.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./failed-tests.md >> $GITHUB_STEP_SUMMARY
- name: "Commit cycle updates"
run: |
git config user.name github-actions
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/verilator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ jobs:
- name: "Print step summary"
run: |
nix run ".#ci-helper" -- postCI \
--failed-tests-file-path ./failed-tests.md \
--cycle-update-file-path ./cycle-update.md
--emu-lib "verilator" \
--top ${{ env.EMU_TOP }}
cat ./failed-tests.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./cycle-update.md >> $GITHUB_STEP_SUMMARY
25 changes: 5 additions & 20 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ object Main:
val failedTests = findFailedTests()
if failedTests.isEmpty then Logger.info(s"All tests passed")
else
os.write.append(
os.Path(sys.env("GITHUB_STEP_SUMMARY")),
failedTests.map(s => s"* ${s}\n").mkString
)
Logger.fatal(
s"${BOLD}${failedTests.length} tests failed${RESET}"
)
Expand All @@ -211,10 +215,6 @@ object Main:
// * collect and report cycle update
@main
def postCI(
@arg(
name = "failed-tests-file-path",
doc = "specify the failed tests markdown file output path"
) failedTestsFilePath: String,
@arg(
name = "cycle-update-file-path",
doc = "specify the cycle update markdown file output path"
Expand All @@ -232,9 +232,6 @@ object Main:
doc = "Specify emulator ip top, Eg. t1rocketemu/t1emu..."
) top: String
) =
val failedTestsFile = os.Path(failedTestsFilePath, os.pwd)
os.write.over(failedTestsFile, "## Failed Tests\n")

os.write.over(
os.Path(cycleUpdateFilePath, os.pwd),
"## Cycle Update\n"
Expand All @@ -256,18 +253,6 @@ object Main:
)
)

Logger.info("Collecting failed tests")
os.walk(emuResultPath)
.filter(path => path.last == "offline-check-status")
.filter(path => os.read(path).trim() != "0")
.map(path => {
val caseName = path.segments.toSeq.reverse.drop(1).head
os.write.append(
failedTestsFile,
s"* ${config} - ${caseName}: `nix build .#t1.$config.${top}.$caseName.$emuLib-emu -L --impure`\n"
)
})

if cycleUpdateFilePath.nonEmpty then
Logger.info("Collecting cycle update info")
val allCycleUpdates = os
Expand Down Expand Up @@ -397,5 +382,5 @@ object Main:
.pipe(println)
end generateRegressionTestPlan

def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toSeq)
end Main
2 changes: 1 addition & 1 deletion script/emu/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -431,5 +431,5 @@ object Main:
.foreach(p => println(s"* ${p}"))
end listCases

def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toSeq)
end Main

0 comments on commit d1e9a53

Please sign in to comment.