You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2026/03/13 18:27:36 UTC

(kudu) branch master updated: Add swagger verification test target

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

alexey 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 e890295e3 Add swagger verification test target
e890295e3 is described below

commit e890295e33935dc85851ea1d5aeeed2585bc791f
Author: Gabriella Lotz <lo...@gmail.com>
AuthorDate: Wed Feb 25 15:45:22 2026 +0100

    Add swagger verification test target
    
    Wire the swagger spec checker into the master test suite via a
    script wrapper so it runs with regular test execution.
    
    Alternatives considered:
    - Standalone custom target (e.g. verify_swagger_spec): lower risk but opt‑in,
      so it’s easy to miss in day‑to‑day testing.
    - Top‑level docs target (like doxygen): runs too infrequently.
    - CI‑only hook: ensures coverage in CI but not in local dev runs.
    
    Chosen approach:
    - Add a test wrapper under the master tests so it runs regularly with
      ctest/test suites while keeping the checker isolated and lightweight.
    
    Manual testing:
    - ctest -R verify_swagger_spec-test
    
    Change-Id: I4f5523eb1fa6792cd81e469169962704d0d27e3b
    Reviewed-on: http://gerrit.cloudera.org:8080/24034
    Reviewed-by: Marton Greber <gr...@gmail.com>
    Tested-by: Marton Greber <gr...@gmail.com>
    Reviewed-by: Alexey Serbin <al...@apache.org>
---
 src/kudu/master/CMakeLists.txt              |  1 +
 src/kudu/master/verify_swagger_spec-test.sh | 49 +++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/src/kudu/master/CMakeLists.txt b/src/kudu/master/CMakeLists.txt
index 8aa16eaa2..b5ffa94d7 100644
--- a/src/kudu/master/CMakeLists.txt
+++ b/src/kudu/master/CMakeLists.txt
@@ -151,3 +151,4 @@ ADD_KUDU_TEST(sys_catalog-test RESOURCE_LOCK "master-web-port")
 ADD_KUDU_TEST(ts_descriptor-test DATA_FILES ../scripts/first_argument.sh)
 ADD_KUDU_TEST(ts_state-test)
 ADD_KUDU_TEST(txn_manager-test RESOURCE_LOCK "master-web-port")
+ADD_KUDU_TEST(verify_swagger_spec-test.sh LABELS no_dist_test)
diff --git a/src/kudu/master/verify_swagger_spec-test.sh b/src/kudu/master/verify_swagger_spec-test.sh
new file mode 100755
index 000000000..d45fa6d5a
--- /dev/null
+++ b/src/kudu/master/verify_swagger_spec-test.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Wrapper to run the swagger verification script via the test harness.
+
+set -euo pipefail
+
+if [ -n "${KUDU_HOME:-}" ]; then
+  # For out-of-tree builds or test runners that copy scripts into temp dirs,
+  # walking up from the script path cannot find the repo. Allow an explicit
+  # override to point at the source root in those cases.
+  REPO_ROOT="$KUDU_HOME"
+else
+  SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
+  SCRIPT_DIR=$(cd "$(dirname "${SCRIPT_PATH}")" && pwd)
+  SEARCH_DIR="$SCRIPT_DIR"
+  REPO_ROOT=""
+
+  while [ "$SEARCH_DIR" != "/" ]; do
+    if [ -f "$SEARCH_DIR/build-support/verify_swagger_spec.py" ]; then
+      REPO_ROOT="$SEARCH_DIR"
+      break
+    fi
+    SEARCH_DIR=$(cd "$SEARCH_DIR/.." && pwd)
+  done
+fi
+
+if [ -z "$REPO_ROOT" ]; then
+  echo "Unable to locate repo root containing build-support/verify_swagger_spec.py"
+  exit 1
+fi
+
+python3 "$REPO_ROOT/build-support/verify_swagger_spec.py"