[asterisk-dev] Python 3 test suite
asterisk at phreaknet.org
asterisk at phreaknet.org
Thu Sep 1 08:52:13 CDT 2022
On 9/1/2022 7:53 AM, Joshua C. Colp wrote:
> On Thu, Sep 1, 2022 at 8:07 AM <asterisk at phreaknet.org
> <mailto:asterisk at phreaknet.org>> wrote:
>
> On 8/31/2022 7:47 PM, Michael Bradeen wrote:
> > Hello again!
> >
> > The Python3 release of the testsuite has been merged. The wiki has
> > been updated and will continue to update as things change.
> >
> > As indicated before, with this change running the testsuite on
> Python2
> > is no longer supported. Please check the wiki for any questions
> and
> > reply on the forum or this email with questions that come up!
> Thanks for the update Mike, and all the work involved in this,
>
> I was able to get the runInVenv.sh script to finally run last
> night,
> after installing a few additional Debian packages (python3-dev and
> python3-venv)
> (I wonder if an install_prereqs.sh for the test suite might be
> useful at
> some point, but that's for a different day)
>
>
> There already is one in the same place as the Asterisk one,
> contrib/scripts/install_prereq
I went ahead and ran that on a different system.
At the end, I get:
#############################################
## install completed successfully
#############################################
Testsuite requires python version >= 3.6.8
Your installed python is
Python 2.7.18
However, I got this when running:
(note, this was with setupVenv.sh patched to remove the output direction
- otherwise you get absolutely nothing)
root at debian11:/usr/src/testsuite# ./runInVenv.sh python runtests.py -l
Reinstall required, removing and recreating venv
The virtual environment was not created successfully because ensurepip
is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the
python3-venv
package, recreate your virtual environment.
Failing command: ['/usr/src/testsuite/.venv/bin/python3', '-Im',
'ensurepip', '--upgrade', '--default-pip']
One of the pre-reqs that caused issues before is covered, but
python3-venv still needs to be added to the install_prereq script
actually. And at the moment, since all errors are going into the ether,
there's no indication at all of this issue.
I can submit a review to add this pre-req; it sounded like maybe further
discussion was warranted on the error output redirection but I still
think that's the more appropriate way to do it.
On the upside, now runtests.py can "find" Asterisk stuff, unlike before,
so install_prereq was actually key to making it work. I'm encountering
other issues, but at least tests themselves are trying to run, which is
progress:
root at debian11:/usr/src/testsuite# ./runInVenv.sh python runtests.py
--test=tests/apps
Running tests for Asterisk (run 1 of 1)...
Tests to run: 153 * 1 time(s) = 153 Maximum test inactivity time: 0 sec.
--> Running test
'tests/apps/agents/agent_acknowledge/agent_acknowledge_error' ...
Making sure Asterisk isn't running ...
Making sure SIPp isn't running...
Running tests/apps/agents/agent_acknowledge/agent_acknowledge_error ...
[Sep 01 09:52:09] WARNING[2716462]: asterisk.asterisk:246 errReceived:
Asterisk 127.0.0.1 received error: ASTdb initialization failed.
ASTERISK EXITING!
I was wondering if maybe python should be python3, given my default is
2.7 apparently, but I guess that wasn't necessary.
I think it would be good to add a note about this to the wiki[1], as
opposed to install various things ad hoc individually. This page[2] does
mention the script, but it says it's for Python 2 and makes it seem like
the script is obsolete, so if that's not the case, then maybe that
should be updated.
[1] https://wiki.asterisk.org/wiki/display/AST/Using+Python3
[2]
https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite
NA
More information about the asterisk-dev
mailing list