From d1e9a532751b3ed00c831df9a8767ddf0ef838b4 Mon Sep 17 00:00:00 2001 From: Avimitin Date: Mon, 11 Nov 2024 13:05:05 +0800 Subject: [PATCH] [ci] move failed test report to each bucket 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 --- .github/workflows/t1rocket.yml | 3 --- .github/workflows/vcs.yml | 3 --- .github/workflows/verilator.yml | 2 -- script/ci/src/Main.scala | 25 +++++-------------------- script/emu/src/Main.scala | 2 +- 5 files changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/t1rocket.yml b/.github/workflows/t1rocket.yml index 638549fbb..b61857a01 100644 --- a/.github/workflows/t1rocket.yml +++ b/.github/workflows/t1rocket.yml @@ -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 diff --git a/.github/workflows/vcs.yml b/.github/workflows/vcs.yml index 810638c08..58749a8df 100644 --- a/.github/workflows/vcs.yml +++ b/.github/workflows/vcs.yml @@ -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 diff --git a/.github/workflows/verilator.yml b/.github/workflows/verilator.yml index fdfc4e44e..634489afa 100644 --- a/.github/workflows/verilator.yml +++ b/.github/workflows/verilator.yml @@ -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 diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index e90f5a7ff..0b6469286 100644 --- a/script/ci/src/Main.scala +++ b/script/ci/src/Main.scala @@ -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}" ) @@ -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" @@ -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" @@ -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 @@ -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 diff --git a/script/emu/src/Main.scala b/script/emu/src/Main.scala index 4fc68e5d8..370327af1 100644 --- a/script/emu/src/Main.scala +++ b/script/emu/src/Main.scala @@ -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