From a435e3108d82eb96d9b3954c1935afbbf4c5f69b Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Tue, 7 Apr 2026 00:36:21 -0500 Subject: [PATCH] [ROCm][CI] Fix test repo-root assumptions (#39053) Signed-off-by: Andreas Karatzas --- .../ec_connector/integration/run_epd_correctness_test.sh | 5 +++-- .../v1/kv_connector/nixl_integration/run_accuracy_test.sh | 7 +++++-- .../v1/kv_connector/nixl_integration/run_edge_case_test.sh | 5 +++-- .../nixl_integration/run_tpu_disagg_accuracy_test.sh | 5 +++-- .../nixl_integration/run_tpu_edge_case_test.sh | 3 ++- .../nixl_integration/run_xpu_disagg_accuracy_test.sh | 3 ++- .../nixl_integration/spec_decode_acceptance_test.sh | 4 +++- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/tests/v1/ec_connector/integration/run_epd_correctness_test.sh b/tests/v1/ec_connector/integration/run_epd_correctness_test.sh index ffe9cac38..e199a3ece 100644 --- a/tests/v1/ec_connector/integration/run_epd_correctness_test.sh +++ b/tests/v1/ec_connector/integration/run_epd_correctness_test.sh @@ -15,8 +15,9 @@ # set -xe -# Find the git repository root directory -GIT_ROOT=$(git rev-parse --show-toplevel) +# Resolve the repository root from the script location instead of `.git`. +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" # Model to test MODEL="${MODEL:-Qwen/Qwen2.5-VL-3B-Instruct}" diff --git a/tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh b/tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh index fe9524960..fc446a0e7 100755 --- a/tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh +++ b/tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh @@ -85,8 +85,11 @@ DECODE_BLOCK_SIZE=${DECODE_BLOCK_SIZE:-128} # Comma-separated extra args for vllm serve (e.g. --max-model-len,2048) VLLM_SERVE_EXTRA_ARGS=${VLLM_SERVE_EXTRA_ARGS:-} -# Find the git repository root directory -GIT_ROOT=$(git rev-parse --show-toplevel) +# Resolve the repository root from the script location instead of `.git`. +# The ROCm CI image copies `/vllm-workspace` without the Git metadata, so +# `git rev-parse --show-toplevel` is not reliable at runtime. +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" SMI_BIN=$(which nvidia-smi || which rocm-smi || echo "") diff --git a/tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh b/tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh index 703a27fd3..9d8e4df8c 100755 --- a/tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh +++ b/tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh @@ -33,8 +33,9 @@ MODELS=( "Qwen/Qwen3-0.6B" ) -# Find the git repository root directory -GIT_ROOT=$(git rev-parse --show-toplevel) +# Resolve the repository root from the script location instead of `.git`. +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" # Trap the SIGINT signal (triggered by Ctrl+C) trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT diff --git a/tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh b/tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh index 407542eb8..9274e3c57 100644 --- a/tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh +++ b/tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh @@ -20,7 +20,8 @@ BLOCK_SIZE=${BLOCK_SIZE:-32} # execution env -GIT_ROOT=$(git rev-parse --show-toplevel) +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" EXP_ROOT="${GIT_ROOT}/tests/v1/kv_connector/nixl_integration" CONDA_PATH=${CONDA_PATH:-"/home/${USER}/anaconda3"} CONDA_ENV_NAME=${CONDA_ENV_NAME:-"nixl"} @@ -153,4 +154,4 @@ echo "-----P/D success----" rm "${OUTPUT_FILE}" cleanup -exit 0 \ No newline at end of file +exit 0 diff --git a/tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh b/tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh index f32ef5e76..596945502 100644 --- a/tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh +++ b/tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh @@ -20,7 +20,8 @@ BLOCK_SIZE=${BLOCK_SIZE:-32} # execution env -GIT_ROOT=$(git rev-parse --show-toplevel) +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" EXP_ROOT="${GIT_ROOT}/tests/v1/kv_connector/nixl_integration" CONDA_PATH=${CONDA_PATH:-"/home/${USER}/anaconda3"} CONDA_ENV_NAME=${CONDA_ENV_NAME:-"nixl"} diff --git a/tests/v1/kv_connector/nixl_integration/run_xpu_disagg_accuracy_test.sh b/tests/v1/kv_connector/nixl_integration/run_xpu_disagg_accuracy_test.sh index 79863123b..8340720f9 100644 --- a/tests/v1/kv_connector/nixl_integration/run_xpu_disagg_accuracy_test.sh +++ b/tests/v1/kv_connector/nixl_integration/run_xpu_disagg_accuracy_test.sh @@ -44,7 +44,8 @@ DECODER_ZE_AFFINITY_MASK=${DECODER_ZE_AFFINITY_MASK:-$(generate_affinity_mask "$ # execution env -GIT_ROOT=$(git rev-parse --show-toplevel) +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" EXP_ROOT="${GIT_ROOT}/tests/v1/kv_connector/nixl_integration" OUTPUT_FILE=${OUTPUT_FILE:-"${EXP_ROOT}/.xpu_accuracy_test_outputs.txt"} diff --git a/tests/v1/kv_connector/nixl_integration/spec_decode_acceptance_test.sh b/tests/v1/kv_connector/nixl_integration/spec_decode_acceptance_test.sh index c2c938ebf..a82dae2d5 100755 --- a/tests/v1/kv_connector/nixl_integration/spec_decode_acceptance_test.sh +++ b/tests/v1/kv_connector/nixl_integration/spec_decode_acceptance_test.sh @@ -52,7 +52,9 @@ DECODER_TP_SIZE=${DECODER_TP_SIZE:-1} GPU_MEMORY_UTILIZATION=${GPU_MEMORY_UTILIZATION:-0.7} BLOCK_SIZE=${BLOCK_SIZE:-16} -GIT_ROOT=$(git rev-parse --show-toplevel) +# Resolve the repository root from the script location instead of `.git`. +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +GIT_ROOT="${GIT_ROOT:-$(cd -- "${SCRIPT_DIR}/../../../.." && pwd -P)}" SMI_BIN=$(which nvidia-smi || which rocm-smi || echo "")