mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | # |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 3 | # Copyright (C) 2022-2024 Nordix Foundation. |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # ============LICENSE_END========================================================= |
| 17 | # |
| 18 | # This script installs common libraries required by CSIT tests |
| 19 | # |
| 20 | # Branched from ccsdk/distribution to this repository Feb 23, 2021 |
| 21 | # |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 22 | echo "---> prepare-csit.sh" |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 23 | |
| 24 | if [ -z "$WORKSPACE" ]; then |
| 25 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 26 | fi |
| 27 | |
| 28 | TESTPLANDIR=${WORKSPACE}/${TESTPLAN} |
| 29 | |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 30 | # Version should match those used to setup robot-framework in other jobs/stages |
| 31 | # Use pyenv for selecting the python version |
| 32 | if [[ -d "/opt/pyenv" ]]; then |
| 33 | echo "Setup pyenv:" |
| 34 | export PYENV_ROOT="/opt/pyenv" |
| 35 | export PATH="$PYENV_ROOT/bin:$PATH" |
| 36 | pyenv versions |
| 37 | if command -v pyenv 1>/dev/null 2>&1; then |
| 38 | eval "$(pyenv init - --no-rehash)" |
| 39 | # Choose the latest numeric Python version from installed list |
| 40 | version=$(pyenv versions --bare | sed '/^[^0-9]/d' | sort -V | tail -n 1) |
| 41 | pyenv local "${version}" |
| 42 | fi |
| 43 | fi |
| 44 | |
| 45 | # Assume that if ROBOT3_VENV is set and virtualenv with system site packages can be activated, |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 46 | # ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already |
| 47 | # been executed |
| 48 | |
| 49 | if [ -f ${WORKSPACE}/env.properties ]; then |
| 50 | source ${WORKSPACE}/env.properties |
| 51 | fi |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 52 | if [ -f ${ROBOT3_VENV}/bin/activate ]; then |
| 53 | source ${ROBOT3_VENV}/bin/activate |
| 54 | else |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 55 | rm -rf /tmp/ci-management |
| 56 | rm -f ${WORKSPACE}/env.properties |
| 57 | cd /tmp |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 58 | git clone "https://gerrit.onap.org/r/ci-management" |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 59 | source ${WORKSPACE}/install-robotframework.sh |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 60 | fi |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 61 | |
| 62 | # install eteutils |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 63 | mkdir -p ${ROBOT3_VENV}/src/onap |
| 64 | rm -rf ${ROBOT3_VENV}/src/onap/testsuite |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 65 | |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 66 | python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==11.0.0.dev17' --pre |
| 67 | |
| 68 | echo "Versioning information:" |
| 69 | python3 --version |
mpriyank | 220711e | 2022-03-11 17:22:24 +0530 | [diff] [blame] | 70 | pip freeze |
| 71 | |
emaclee | 75d07ea | 2024-01-18 12:44:58 +0000 | [diff] [blame^] | 72 | python3 -m robot.run --version || : |