Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix ci-report output formatting issues (#68505)

bryan087a317f708a
diff --git a/mage/src/mage/ci_report.clj b/mage/src/mage/ci_report.clj
index ce15ac227c3..511ecd1b19a 100644
--- a/mage/src/mage/ci_report.clj
+++ b/mage/src/mage/ci_report.clj
@@ -141,13 +141,16 @@
(cond
;; Summary line: "Total: X Pass: Y Fail: Z"
(re-find #"Total:.*Pass:.*Fail:" line)
- (let [clean-line (str/replace line #"^[0-9T:.Z-]+ +" "")]
- (swap! results conj {:type :summary :text (str/trim clean-line)}))
- ;; Failed count line (contains "test" and "failed" but not config text)
+ (when-let [match (re-find #"Total:.*" line)]
+ (swap! results conj {:type :summary :text (str/trim match)}))
+ ;; Failed count line (contains "failed" and "quarantined" or "not quarantined")
(and (str/includes? line "failed")
- (str/includes? line "quarantined"))
- (let [clean-line (str/replace line #"^[0-9T:.Z-]+ +" "")]
- (swap! results conj {:type :failed-count :text (str/trim clean-line)}))
+ (or (str/includes? line "quarantined")
+ (str/includes? line "not quarantined")))
+ (let [;; Extract just the meaningful part: "X test(s) failed..."
+ match (re-find #"\d+\s+tests?\s+failed.*" line)]
+ (when match
+ (swap! results conj {:type :failed-count :text (str/trim match)})))
;; Package name with 📦
(str/includes? line "📦")
(when-let [pkg (re-find #"metabase[\w.-]+-test" line)]
@@ -273,9 +276,9 @@
(if (seq formatted)
(do (println "**Test Failures:**")
(println)
- (println "```")
+ (println "````")
(println formatted)
- (println "```"))
+ (println "````"))
(println "_No test failures found in logs._")))
(println "_Logs not yet available or run still in progress._")))
(println)))
@@ -290,7 +293,7 @@
(println "---")
(println)
- (println (format "_Generated by `bin/ci-failures.bb` at %s UTC_"
+ (println (format "_Generated by `mage ci-report` at %s UTC_"
(.format (java.time.LocalDateTime/now)
(java.time.format.DateTimeFormatter/ofPattern "yyyy-MM-dd HH:mm:ss"))))))