You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ko...@apache.org on 2025/02/26 08:24:06 UTC

(ignite-3) branch main updated: IGNITE-24616 Sql. Improve error reporting in SqlLogic test runner (#5285)

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

korlov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 16bdd266e53 IGNITE-24616 Sql. Improve error reporting in SqlLogic test runner (#5285)
16bdd266e53 is described below

commit 16bdd266e537cb26eb94d74be1d8c2fa6f76905e
Author: korlov42 <ko...@apache.org>
AuthorDate: Wed Feb 26 10:24:01 2025 +0200

    IGNITE-24616 Sql. Improve error reporting in SqlLogic test runner (#5285)
---
 .../apache/ignite/internal/sql/sqllogic/Statement.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/Statement.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/Statement.java
index 503978b17e5..1993cb414fe 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/Statement.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/Statement.java
@@ -28,6 +28,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import org.apache.ignite.internal.lang.IgniteStringBuilder;
+import org.apache.ignite.internal.util.ExceptionUtils;
 import org.hamcrest.Matcher;
 import org.jetbrains.annotations.Nullable;
 import org.junit.jupiter.api.Assertions;
@@ -113,15 +115,25 @@ final class Statement extends Command {
                     Assertions.fail("Not expected result at: " + posDesc + ". Statement: " + qry, e);
                 }
             } else {
+                IgniteStringBuilder detailsBuilder = new IgniteStringBuilder("Not expected result at: ")
+                        .app(posDesc).app('.').nl()
+                        .app('\t').app("Statement: ").app(qry).app('.').nl()
+                        .app('\t').app("Expected: ");
+
                 Throwable err = Assertions.assertThrows(
                         Throwable.class,
                         () -> ctx.executeQuery(qry),
-                        "Not expected result at: " + posDesc + ". Statement: " + qry + ". No error occurred");
+                        () -> detailsBuilder.app("error, but none was occurred.").toString()
+                );
 
                 Matcher<String> errorMatcher = expected.errorMatcher(ctx);
 
+                detailsBuilder.app(expected.errorMessage).nl()
+                        .app('\t').app("Actual: ").nl()
+                        .app(ExceptionUtils.getFullStackTrace(err));
+
                 assertThat(
-                        "Not expected result at: " + posDesc + ". Statement: " + qry + ". Expected: " + expected.errorMessage,
+                        detailsBuilder.toString(),
                         err.getMessage(), errorMatcher);
             }
         }