[asterisk-dev] Python 3 test suite

asterisk at phreaknet.org asterisk at phreaknet.org
Thu Sep 1 06:06:35 CDT 2022


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)

As I hinted before, I feel pretty strongly that stderr in ./setupVenv.sh 
should not be discarded. The first time I ran it, there were errors that 
pointed me towards the missing packages. This actually happened a couple 
times. If there was an install_prereq.sh, that would be one thing, but 
since there isn't, I think that no output should be discarded by 
default, and certainly stderr should not be. Patching that script to 
remove output redirection to /dev/null was the first step. If there's a 
problem, the user needs to know (or other steps need to be taken to 
ensure there won't be a problem).

With that part working, I seem to be running into a somewhat bizarre 
issue where the test suite can't "find" Asterisk. By this, no tests 
actually run - they all fail because pre-reqs for modules and core files 
aren't met, e.g:
937) tests/pbx/accountcode/dial_predial
       --> Summary: Test dial channel accountcode propagation with 
predial override
       --> Tags: ['pjsip', 'accountcode']
       --> Dependency: app_dial -- Met: False
       --> Dependency: app_echo -- Met: False
       --> Dependency: func_channel -- Met: False
       --> Dependency: res_pjsip -- Met: False

The test suite dependencies *are* satisfied, for tests that need them. 
For example:
929) tests/manager/sendtext
       --> Summary: Send a message via the AMI
       --> Tags: ['pjsip']
       --> Dependency: sipp -- Met: True
       --> Dependency: app_sendtext -- Met: False
       --> Dependency: chan_pjsip -- Met: False
       --> Dependency: res_pjsip -- Met: False
1140) tests/sorcery/memory_cache_stale_object
       --> Summary: Sorcery Memory Cache AMI 
SorceryMemoryCacheStaleObject Test
       --> Tags: ['realtime', 'pjsip']
       --> Dependency: twisted -- Met: True
       --> Dependency: starpy -- Met: True
       --> Dependency: res_pjsip -- Met: False
       --> Dependency: res_config_curl -- Met: False
       --> Dependency: func_curl -- Met: False
       --> Dependency: res_sorcery_realtime -- Met: False
       --> Dependency: res_sorcery_memory_cache -- Met: False

This is on a Debian 10 machine where the test suite previously worked, 
so I'm wondering is there something I need to do in order to make the 
test suite script properly find the location of the Asterisk modules or 
something like that? I didn't see anything about this on that webpage. I 
did run make install-headers on the existing Asterisk install, as I 
wasn't sure that had been done before, but everything else is in 
accordance with the guidelines. Only difference I can think of is I did 
use COMPILE_DOUBLE, but I can't see what they would be relevant.

Any insight appreciated - thanks!

NA



More information about the asterisk-dev mailing list