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

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


The following commit(s) were added to refs/heads/master by this push:
     new 54e4ddae3b tests: minor autest script fixes (#9891)
54e4ddae3b is described below

commit 54e4ddae3b99d3bb02b181c18552557377f7bf7b
Author: James Peach <[email protected]>
AuthorDate: Thu Jun 22 09:21:07 2023 +1000

    tests: minor autest script fixes (#9891)
    
    * switch to the tests directory before trying to run scripts from it
    * don't check for the unnecessary Python devel tools
    * use the preferred bash, not the (obsolete on macOS) one in /bin
    * exit if Python isn't available
    
    Signed-off-by: James Peach <[email protected]>
---
 tests/autest.sh                 | 14 ++++++++------
 tests/prepare_proxy_verifier.sh |  2 +-
 tests/test-env-check.sh         | 14 +++-----------
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/tests/autest.sh b/tests/autest.sh
index 5ed1296208..83658bc41a 100755
--- a/tests/autest.sh
+++ b/tests/autest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /usr/bin/env bash
 # vim: sw=4:ts=4:softtabstop=4:ai:et
 
 #  Licensed to the Apache Software Foundation (ASF) under one
@@ -17,18 +17,20 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+readonly SCRIPT_DIR
+
 fail()
 {
     echo $1
     exit 1
 }
+
+cd "$SCRIPT_DIR"
+
 ./prepare_proxy_verifier.sh || fail "Failed to install Proxy Verifier."
-pushd $(dirname $0) > /dev/null
 export PYTHONPATH=$(pwd):$PYTHONPATH
 ./test-env-check.sh || fail "Failed Python environment checks."
 # this is for rhel or centos systems
 echo "Environment config finished. Running AuTest..."
-pipenv run autest "$@" -D gold_tests
-ret=$?
-popd > /dev/null
-exit $ret
+exec pipenv run autest "$@" -D gold_tests
diff --git a/tests/prepare_proxy_verifier.sh b/tests/prepare_proxy_verifier.sh
index 72abbc92fe..a128354111 100755
--- a/tests/prepare_proxy_verifier.sh
+++ b/tests/prepare_proxy_verifier.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /usr/bin/env bash
 # vim: sw=4:ts=4:softtabstop=4:ai:et
 
 #  Licensed to the Apache Software Foundation (ASF) under one
diff --git a/tests/test-env-check.sh b/tests/test-env-check.sh
index d280d2d05b..aae6cda198 100755
--- a/tests/test-env-check.sh
+++ b/tests/test-env-check.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /usr/bin/env bash
 
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
@@ -26,20 +26,11 @@ _END_
 
 if [ $? = 1 ]; then
     echo "Python 3.6 or newer is not installed/enabled."
-    return
+    exit 1
 else
     echo "Python 3.6 or newer detected!"
 fi
 
-# check for python development header -- for autest
-python3-config &> /dev/null
-if [ $? = 1 ]; then
-    echo "python3-dev/devel detected!"
-else
-    echo "python3-dev/devel is not installed. "
-    return
-fi
-
 # check for pipenv
 pipenv --version &> /dev/null
 if [ $? -eq 0 ]; then
@@ -53,4 +44,5 @@ if [ $? -eq 0 ]; then
     fi
 else
     echo "pipenv is not installed/enabled. "
+    exit 1
 fi

Reply via email to