Compare commits

...

2 Commits

Author SHA1 Message Date
Mike Bradeen
b7c6094e51 CI: additional python venv requirements
ASTERISK-26826

Change-Id: I9b281591e90d661fa9480a3b2b10f6ead0602b0e
2022-08-03 09:05:59 -06:00
Mike Bradeen
ee85895d88 CI: Use virtual environment for testsuite
As part of the move to Python3, the testsuite is now designed
to work with a virtual environment.

This change is to have runTestsuite use the venv method if
possible and fall back if it can't.  If the script is run from
an externally activated virtual enviroment, then use that and
don't try either method.

Change-Id: I9724c446d67a5ee9e550644e4a78739de823536e
2022-06-27 13:44:21 -06:00

View File

@@ -12,13 +12,34 @@ fi
pushd $TESTSUITE_DIR
if [[ "$VIRTUAL_ENV" != "" ]]
then
echo "Detected activated virtual environment:"
echo $VIRTUAL_ENV
echo "Skipping creation of new environment"
else
python3 -m venv ${TESTSUITE_DIR}/.venv
source ${TESTSUITE_DIR}/.venv/bin/activate
if [[ "$VIRTUAL_ENV" != "" ]]
then
echo "Successfully activated virtual environment:"
echo $VIRTUAL_ENV
python -m pip install --upgrade pip
python -m pip install wheel setuptools build
python -m pip install -r ./requirements.txt
python -m pip install -r ./extras.txt
else
echo "Virtual environment failed, attempting fall-back method"
export PYTHONPATH=./lib/python/
fi
fi
./cleanup-test-remnants.sh
if [ $REALTIME -eq 1 ] ; then
$CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}
fi
export PYTHONPATH=./lib/python/
echo "Running tests ${TESTSUITE_COMMAND} ${AST_WORK_DIR:+with work directory ${AST_WORK_DIR}}"
./runtests.py --cleanup --timeout=${TEST_TIMEOUT} ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :