diff --git a/utils/ci/scripts_e2e/pull_optestrunner.sh b/utils/ci/scripts_e2e/pull_optestrunner.sh new file mode 100755 index 0000000000000000000000000000000000000000..ec5469fd7a03a103a56cd29996a85057ed3b6a33 --- /dev/null +++ b/utils/ci/scripts_e2e/pull_optestrunner.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +################################################################################ +# This Script pull the optestrunner binaries and installs them +################################################################################ + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +OP_REPO_DIR="${OP_REPO_DIR:=$SCRIPT_DIR/../../..}" +#ToDo: Set this variable at the top level +if [[ -z "${OP_TESTRUNNER_DIR}" ]]; then + # If not defined, set a default value + OP_TESTRUNNER_DIR="$SCRIPT_DIR/../../../../optestrunner" + echo "WARN: OP_TESTRUNNER_DIR variable is not set. Setting it to: + OP_TESTRUNNER_DIR is ${OP_TESTRUNNER_DIR}" +fi + +mkdir -p "$OP_TESTRUNNER_DIR" && cd "$OP_TESTRUNNER_DIR" || exit 1 +rm -rf -- * || { echo "Failed to clean $OP_TESTRUNNER_DIR directory"; exit 1; } + +echo "Python virtual environment (.env) is being created at ${OP_REPO_DIR}" + +"${PYTHON_EXECUTABLE}" -m venv "${OP_REPO_DIR}/.env" +venv_python_executable="${OP_REPO_DIR}/.env/bin/python3" + +"${venv_python_executable}" -m pip install --upgrade pip +"${venv_python_executable}" -m pip install "${OPTESTRUNNER_URL}" || { echo "Failed to install dependencies"; exit 1; } + +echo "Following packages are installed successfully in the virtual environment at ${OP_REPO_DIR}/.env." + +"${venv_python_executable}" -m pip list -v