<div dir="ltr"><div dir="ltr">On Thu, Sep 29, 2022 at 8:57 AM Henning Westerholt <<a href="mailto:hw@gilawa.com">hw@gilawa.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-106107965063861443">
<div lang="DE" style="overflow-wrap: break-word;">
<div class="m_-106107965063861443WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-GB">is there a current documentation about setup the asterisk unit tests? This documentation seems to be outdated:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Installing+the+Asterisk+Test+Suite</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I also followed some blog posts from on <a href="http://asterisk.org" target="_blank">asterisk.org</a>, but they also did not help as they seem to be outdated as well.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The docs specify that the unit test framework is still using python2.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">But according to the contrib/scripts/install_prereq its already switched to python3, which is also indicated in the runtest.py command.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Unfortunately, the starpy fails for python3:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> </testcase><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> <testcase classname="rtp.strict_rtp" name="strict_rtp_yes" time="0.62"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> <failure>Running tests/rtp/strict_rtp/strict_rtp_yes ...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[…]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">data=None, variable={}, async=False, channelid=None,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">^<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">SyntaxError: invalid syntax<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"></failure><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Apparently async is a reserved keyword now on python 3.7. The used distribution is Debian Buster, so nothing bleeding edge.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I found a (one year old) pull-request at <a href="https://github.com/asterisk/starpy/pull/46/files" target="_blank">
https://github.com/asterisk/starpy/pull/46/files</a> that aparently fixes that bug.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">There is also another issue related to starpy:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[Sep 28 16:28:00] ERROR[28954]: asterisk.test_case:607 _ami_connect: Exception raised in ami_connect:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">[..]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">File "/usr/local/lib/python3.7/dist-packages/starpy-1.0.3-py3.7.egg/starpy/manager.py", line 729, in inner<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">return func(*args, **kwargs)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">TypeError: originate() got an unexpected keyword argument 'nowait'<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Test tests/apps/control_playback/nominal failed<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I am a bit confused if this is the maintained way to use this framework.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">After spending one day on that I found by chance this post:
<a href="https://wiki.asterisk.org/wiki/display/AST/Using+Python3" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Using+Python3</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">This seems to depend on a starpy version 1.1, which is not visible at all in the actual github its located.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Is this the appropriate way of running this framework now?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If yes, it would be great to add a note or link it at the generic test suite documentation above, to save other people time to figure all this stuff out.</span></p></div></div></div></blockquote><div><br></div><div>This is the appropriate way to run the framework, and I've updated the "Using Python3" page and also the "Installing the Asterisk Test Suite" page. Sorry for the trouble, the dust is still settling on the huge move to Python 3. </div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Project Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>