diff options
author | Matthew Watkins <mwatkins@linuxfoundation.org> | 2022-12-15 17:03:16 +0000 |
---|---|---|
committer | Matthew Watkins <mwatkins@linuxfoundation.org> | 2022-12-15 17:12:29 +0000 |
commit | 438fbd45a9ddca70712e147175948f1f8e78d4db (patch) | |
tree | 249ef6baafe67d50f7c06e3d49858eed45d709bf /csit/run-csit.sh | |
parent | 96c8e88e3750a16fa66d3f16ea0c84c0daf0be8f (diff) |
Chore: Update robot-framework scripts to use Python3.10
Migrate these CSIT scripts to explicitly use the latest Python 3.x
version available in pyenv, the same as the earlier jobs that setup
the robot framework environment. Also, output some useful versioning
information to aid debugging.
Issue-ID: CCSDK-3820
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Change-Id: I332f2c46018d4c3433f0a3df9a0f35bb90241b07
Diffstat (limited to 'csit/run-csit.sh')
-rwxr-xr-x | csit/run-csit.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/csit/run-csit.sh b/csit/run-csit.sh index 6703160a37..9a344c1ffd 100755 --- a/csit/run-csit.sh +++ b/csit/run-csit.sh @@ -20,14 +20,29 @@ # Branched from ccsdk/distribution to this repository Feb 23, 2021 +echo "---> run-csit.sh" + WORKDIR=$(mktemp -d --suffix=-robot-workdir) +# Version should match those used to setup robot-framework in other jobs/stages +# Use pyenv for selecting the python version +if [[ -d "/opt/pyenv" ]]; then + echo "Setup pyenv:" + export PYENV_ROOT="/opt/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + pyenv versions + if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init - --no-rehash)" + # Choose the latest numeric Python version from installed list + version=$(pyenv versions --bare | sed '/^[^0-9]/d' | sort -V | tail -n 1) + pyenv local "${version}" + fi +fi + # # functions # -echo "---> run-csit.sh" - # wrapper for sourcing a file function source_safely() { [ -z "$1" ] && return 1 @@ -192,6 +207,12 @@ SUITES=$( xargs -a testplan.txt ) echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" echo "Starting Robot test suites ${SUITES} ..." relax_set + +echo "Versioning information:" +python3 --version +pip freeze +python3 -m robot.run --version || : + python3 -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} RESULT=$? load_set |