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

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

commit 3a6987e09b7f76b2b2c4c7c3b599cbdd4b509209
Author: Laszlo Gaal <[email protected]>
AuthorDate: Sat Feb 24 15:52:35 2024 +0100

    IMPALA-12842: Make node.js installation aware of CPU architecture
    
    The earlier version of the installation logic in
    tests/run-js-test-on-arm.sh always used 'linux-x86' as the architecture
    tag for the downloaded node.js installation package, which made the
    tests themselves fail when running on an instance powered by an ARM
    (Graviton) CPU.
    
    This patch uses the $ARCH_NAME environment variable set up in
    bin/impala-config.sh to add the correct CPU architecture tag to the URL
    of the node.js package to be downloaded. If the rported CPU type is not
    one of the known types (x86_64 or aarch64), the installation step throws
    and error and emits a JUnit XML symptom for Jenkins runs.
    
    Change-Id: Ie22da6237ed6d19cf8af721df471033fdfe6b23a
    Reviewed-on: http://gerrit.cloudera.org:8080/21070
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Reviewed-by: Surya Hebbar <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/run-js-tests.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/run-js-tests.sh b/tests/run-js-tests.sh
index 3a9097c62..7f4cf70bb 100755
--- a/tests/run-js-tests.sh
+++ b/tests/run-js-tests.sh
@@ -24,7 +24,21 @@ setup_report_build_error
 : ${IMPALA_JS_TEST_LOGS_DIR:="${IMPALA_LOGS_DIR}/js_tests"}
 
 NODEJS_VERSION=v16.20.2
-NODEJS_DISTRO=linux-x64
+# ARCH_NAME is set in bin/impala-config.sh
+if [[ $ARCH_NAME == aarch64 ]]; then
+  NODEJS_DISTRO=linux-arm64
+elif [[ $ARCH_NAME == x86_64 ]]; then
+  NODEJS_DISTRO=linux-x64
+else
+  echo "This script supports Intel x86_64 or ARM aarch64 CPU architectures 
only." >&2
+  echo "Current CPU type is reported as $ARCH_NAME" >&2
+  # report the installation failure as a JUnit symptom
+  "${IMPALA_HOME}"/bin/generate_junitxml.py --phase JS_TEST \
+      -- step "node.js installation" \
+      --error "Unknown CPU architecture $ARCH_NAME encountered."
+  exit 1
+fi
+
 NODEJS_LIB_PATH="${IMPALA_TOOLCHAIN}/node-${NODEJS_VERSION}"
 export IMPALA_NODEJS="${NODEJS_LIB_PATH}/bin/node"
 NPM="${NODEJS_LIB_PATH}/bin/npm"

Reply via email to