This is an automated email from the ASF dual-hosted git repository.

MisterRaindrop pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git


The following commit(s) were added to refs/heads/main by this push:
     new c1cb1674 Reduce amount of logs we produce in CI (#140)
c1cb1674 is described below

commit c1cb16745078e40284684226ed1d7393c690f26d
Author: Nikolay Antonov <[email protected]>
AuthorDate: Wed Aug 5 05:41:29 2026 +0500

    Reduce amount of logs we produce in CI (#140)
    
    * CI: introduce maximum length for test report messages
    * truncate in table reporting
---
 .../utils/jsystem/report/ReportUtils.java          | 24 +++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git 
a/automation/src/main/java/org/apache/cloudberry/pxf/automation/utils/jsystem/report/ReportUtils.java
 
b/automation/src/main/java/org/apache/cloudberry/pxf/automation/utils/jsystem/report/ReportUtils.java
index 863793be..5ae76365 100755
--- 
a/automation/src/main/java/org/apache/cloudberry/pxf/automation/utils/jsystem/report/ReportUtils.java
+++ 
b/automation/src/main/java/org/apache/cloudberry/pxf/automation/utils/jsystem/report/ReportUtils.java
@@ -13,6 +13,20 @@ import org.junit.Assert;
  */
 public abstract class ReportUtils {
 
+       // Caps report log size; tests can produce megabytes of logs.
+       private static final int MAX_MESSAGE_LENGTH = 8192;
+       // Chars kept from the message end so a truncated tail (e.g. COPY 
closing) stays visible.
+       private static final int TAIL_LENGTH = 128;
+
+       private static String truncate(String message) {
+               if (message == null || message.length() <= MAX_MESSAGE_LENGTH) {
+                       return message;
+               }
+               String head = message.substring(0, MAX_MESSAGE_LENGTH - 
TAIL_LENGTH);
+               String tail = message.substring(message.length() - TAIL_LENGTH);
+               return head + "... [truncated, " + message.length() + " chars 
total] ..." + tail;
+       }
+
        public static void report(Reporter jsystemReport, Class<?> 
contextClass, String message) {
                report(jsystemReport, contextClass, message, Reporter.PASS);
        }
@@ -27,10 +41,10 @@ public abstract class ReportUtils {
         * @param status use {@link Reporter} Reporter.FAIL or Reporter.PASS
         */
        public static void report(Reporter jsystemReport, Class<?> 
contextClass, String message, int status) {
-               String messageToReport = message;
+               String messageToReport = truncate(message);
 
                if (contextClass != null) {
-                       messageToReport = contextClass.getSimpleName() + " -> " 
+ message;
+                       messageToReport = contextClass.getSimpleName() + " -> " 
+ messageToReport;
                }
                if (jsystemReport != null && !jsystemReport.isSilent()) {
                        jsystemReport.report(messageToReport, status);
@@ -66,7 +80,7 @@ public abstract class ReportUtils {
         * @throws IOException
         */
        public static void startLevel(Reporter jsystemReport, Class<?> 
contextClass, String additionalText, String message) throws IOException {
-               String reportMessage = contextClass.getSimpleName() + " " + 
additionalText + " -> " + message;
+               String reportMessage = contextClass.getSimpleName() + " " + 
additionalText + " -> " + truncate(message);
 
                if (jsystemReport != null && !jsystemReport.isSilent()) {
                        jsystemReport.startLevel(reportMessage);
@@ -107,12 +121,12 @@ public abstract class ReportUtils {
         */
        public static void reportHtml(Reporter jsystemReport, Class<?> 
contextClass, String data) {
                if (jsystemReport != null && !jsystemReport.isSilent()) {
-                       jsystemReport.report(contextClass.getSimpleName() + " 
-> " + data, ReportAttribute.HTML);
+                       jsystemReport.report(contextClass.getSimpleName() + " 
-> " + truncate(data), ReportAttribute.HTML);
                }
        }
 
        public static void reportTable(Table table) {
-               System.out.println(table);
+               System.out.println(table == null ? null : 
truncate(table.toString()));
        }
 
        /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to