<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18965">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: use Python3 virtual environment<br><br>Requires Python3 testsuite changes<br><br>ASTERISK-26826<br><br>Change-Id: I92ec7dec751ad455503a584d6e860db88c56d6bc<br>---<br>M tests/CI/runTestsuite.sh<br>1 file changed, 22 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/18965/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/runTestsuite.sh b/tests/CI/runTestsuite.sh</span><br><span>index 466991a..782beb5 100755</span><br><span>--- a/tests/CI/runTestsuite.sh</span><br><span>+++ b/tests/CI/runTestsuite.sh</span><br><span>@@ -12,13 +12,34 @@</span><br><span> </span><br><span> pushd $TESTSUITE_DIR</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+if [[ "$VIRTUAL_ENV" != "" ]]</span><br><span style="color: hsl(120, 100%, 40%);">+then</span><br><span style="color: hsl(120, 100%, 40%);">+                echo "Detected activated virtual environment:"</span><br><span style="color: hsl(120, 100%, 40%);">+              echo $VIRTUAL_ENV</span><br><span style="color: hsl(120, 100%, 40%);">+             echo "Skipping creation of new environment"</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+   python3 -m venv ${TESTSUITE_DIR}/.venv</span><br><span style="color: hsl(120, 100%, 40%);">+        source ${TESTSUITE_DIR}/.venv/bin/activate</span><br><span style="color: hsl(120, 100%, 40%);">+    if [[ "$VIRTUAL_ENV" != "" ]]</span><br><span style="color: hsl(120, 100%, 40%);">+     then</span><br><span style="color: hsl(120, 100%, 40%);">+          echo "Successfully activated virtual environment:"</span><br><span style="color: hsl(120, 100%, 40%);">+          echo $VIRTUAL_ENV</span><br><span style="color: hsl(120, 100%, 40%);">+             python -m pip install --upgrade pip</span><br><span style="color: hsl(120, 100%, 40%);">+           python -m pip install wheel setuptools build</span><br><span style="color: hsl(120, 100%, 40%);">+          python -m pip install -r ./requirements.txt</span><br><span style="color: hsl(120, 100%, 40%);">+           python -m pip install -r ./extras.txt</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+          echo "Virtual environment failed, attempting fall-back method"</span><br><span style="color: hsl(120, 100%, 40%);">+              export PYTHONPATH=./lib/python/</span><br><span style="color: hsl(120, 100%, 40%);">+       fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ./cleanup-test-remnants.sh</span><br><span> </span><br><span> if [ $REALTIME -eq 1 ] ; then</span><br><span>  $CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-export PYTHONPATH=./lib/python/</span><br><span> echo "Running tests ${TESTSUITE_COMMAND} ${AST_WORK_DIR:+with work directory ${AST_WORK_DIR}}"</span><br><span> ./runtests.py --cleanup --timeout=${TEST_TIMEOUT} ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18965">change 18965</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/18965"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I92ec7dec751ad455503a584d6e860db88c56d6bc </div>
<div style="display:none"> Gerrit-Change-Number: 18965 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>