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

mgreber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 314edd777 Enable REST API endpoints in webserver crawl test
314edd777 is described below

commit 314edd777541daa3200ab1ae9d685f1be26ce5c0
Author: Gabriella Lotz <[email protected]>
AuthorDate: Wed Oct 15 11:40:54 2025 +0200

    Enable REST API endpoints in webserver crawl test
    
    Modified WebserverCrawlITest to enable REST API endpoints by setting
    enable_rest_api = true in the cluster options.
    
    Also added exclusion logic for large JavaScript bundles (like
    swagger-ui-bundle.js) to prevent test failures. The HTML parser
    (gumbo-query) incorrectly treats minified JavaScript as parseable
    HTML content and extracts code fragments as malformed URLs, causing
    curl errors when the test tries to fetch them. These JavaScript files
    are still validated by the initial HTTP fetch; we simply skip the
    inappropriate step of parsing them for links.
    
    Change-Id: I5be128536d4f104e2d3bfa55c02b81e6f114d5fc
    Reviewed-on: http://gerrit.cloudera.org:8080/23548
    Reviewed-by: Alexey Serbin <[email protected]>
    Reviewed-by: Marton Greber <[email protected]>
    Tested-by: Marton Greber <[email protected]>
---
 src/kudu/integration-tests/webserver-crawl-itest.cc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/kudu/integration-tests/webserver-crawl-itest.cc 
b/src/kudu/integration-tests/webserver-crawl-itest.cc
index 32e2c1042..44fa3b363 100644
--- a/src/kudu/integration-tests/webserver-crawl-itest.cc
+++ b/src/kudu/integration-tests/webserver-crawl-itest.cc
@@ -168,6 +168,8 @@ TEST_P(WebserverCrawlITest, TestAllWebPages) {
   opts.num_tablet_servers = 3;
   opts.extra_master_flags = flags;
   opts.extra_tserver_flags = flags;
+  opts.enable_rest_api = true;
+
   ExternalMiniCluster cluster(std::move(opts));
   ASSERT_OK(cluster.Start());
 
@@ -216,6 +218,21 @@ TEST_P(WebserverCrawlITest, TestAllWebPages) {
       return;
     }
 
+    // Skip large JavaScript bundles to avoid HTML parser issues.
+    // The HTML parser treats minified JS as parseable content and extracts
+    // code fragments (like "'+escapeHtml(s[o].href)+'") as malformed URLs,
+    // causing test failures when curl tries to fetch them. These JS files are
+    // still validated by the initial HTTP fetch; we just skip parsing them 
for links.
+    static const vector<string> kExcludedPaths = {
+      "/swagger/swagger-ui-bundle.js",
+    };
+
+    for (const auto& excluded : kExcludedPaths) {
+      if (link.find(excluded) != string::npos) {
+        return;
+      }
+    }
+
     // Verify that the link's scheme matches how we've configured the web UI.
     ASSERT_FALSE(HasPrefixString(link, use_ssl ? kHttpScheme : kHttpsScheme));
 

Reply via email to