Hi Developers,<div><br></div><div>I have been looking at <a href="https://bugs.launchpad.net/nova/+bug/931608" target="_blank">https://bugs.launchpad.net/nova/+bug/931608</a>, "run_tests.sh (-x | --stop) is broken."  A fix was committed but it only stopped "./run_tests.sh -x" from failing, and not restoring the "./run_tests.sh -x" functionality.</div>


<div><br></div><div>"run_tests.sh (-x | --stop)" is a nosetests parameter which gets passed in via nova/testing/runner.py:367.  sys.argv for nova/testing/runner.py, takes two sets of parameters nova parameters and any arbitrary nosetests parameter.  The nova flags (hide-elapsed etc.) are handled via </div>

<span class="Apple-style-span" style="font-family:'Arial Unicode MS',Arial,sans-serif">'flags.FLAGS.register_cli_opt' and the nosetest parameters are generated from the args return value from optparse (nova/openstack/common/cfg.py:768:   "(values, args) = self._oparser.parse_args(self._args)" ).</span><div>

<font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif">The problem is when optparse sees an unknown flag (such as '-x') it terminates the program without throwing an error.  Additionally the 'args' return value doesn't contain the flags just flag arguments (only 'a' in '-x a').  So there is no way of passing on just the unknown flags to nosetest.  Additionally nosetest uses optparse itself so if you pass in sys.argv to nosetest with a nova argument set will case the tests to break too.</font><span class="Apple-style-span" style="font-family:'Lucida Grande';font-size:medium"><a href="member:jog0" title="jog0@2001:5a8:4:68e0:6c74:73c3:c1d7:bd23" class="member self" style="font-weight:bold;color:rgb(170,34,17);text-decoration:none!important;margin-right:0.5ex;white-space:nowrap"></a></span></div>

<div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif">While I can write a hack to look for 'hide-elapsed' or other nova flags, I am looking for more elegant solutions.  Should this solution live in the cfg module?</font></div>

<div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif">best,</font></div>

<div><font class="Apple-style-span" face="'Arial Unicode MS', Arial, sans-serif">Joe Gordon</font></div><div><div><div id="D3ME5FIFSP3" class="envelope" style="padding-top:1px;padding-right:5px;padding-bottom:1px;padding-left:5px;margin-bottom:3px;font-family:'Lucida Grande';font-size:medium">

<span class="timestamp" style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136,136,136);word-wrap:normal"><span class="Apple-style-span" style="color:rgb(0,0,0);font-size:medium"><span class="Apple-style-span" style="color:rgb(136,136,136);font-size:9px"><br>

<br></span></span></span></div><div id="K849E3KFSP3" class="envelope" style="padding-top:1px;padding-right:5px;padding-bottom:1px;padding-left:5px;margin-bottom:3px;font-family:'Lucida Grande';font-size:medium"><a href="member:jog0" title="jog0@2001:5a8:4:68e0:6c74:73c3:c1d7:bd23" class="member self" style="font-weight:bold;color:rgb(170,34,17);text-decoration:none!important;margin-right:0.5ex;white-space:nowrap"></a></div>

</div><div><br></div><div><br></div>
</div>