<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 11:10 AM, Flavio Percoco <span dir="ltr"><<a href="mailto:flavio@redhat.com" target="_blank">flavio@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 10/12/15 08:21 -0600, Brant Knudson wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
On Thu, Dec 10, 2015 at 7:26 AM, Sean Dague <<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a>> wrote:<br>
<br>
   On 12/10/2015 01:56 AM, Joshua Harlow wrote:<br>
   > Shouldn't be to hard (although it's probably not on each oslo project,<br>
   > but on the consumers projects).<br>
   ><br>
   > The warnings module can turn warnings into raised exceptions with a<br>
   > simple command line switch btw...<br>
   ><br>
   > For example:<br>
   ><br>
   > $ python -Wonce<br>
   > Python 2.7.6 (default, Jun 22 2015, 17:58:13)<br>
   > [GCC 4.8.2] on linux2<br>
   > Type "help", "copyright", "credits" or "license" for more information.<br>
   >>>> import warnings<br>
   >>>> warnings.warn("I am not supposed to be used", DeprecationWarning)<br>
   > __main__:1: DeprecationWarning: I am not supposed to be used<br>
   ><br>
   > $ python -Werror<br>
   > Python 2.7.6 (default, Jun 22 2015, 17:58:13)<br>
   > [GCC 4.8.2] on linux2<br>
   > Type "help", "copyright", "credits" or "license" for more information.<br>
   >>>> import warnings<br>
   >>>> warnings.warn("I am not supposed to be used", DeprecationWarning)<br>
   > Traceback (most recent call last):<br>
   >   File "<stdin>", line 1, in <module><br>
   > DeprecationWarning: I am not supposed to be used<br>
   ><br>
   > <a href="https://docs.python.org/2/library/warnings.html#the-warnings-filter" rel="noreferrer" target="_blank">https://docs.python.org/2/library/warnings.html#the-warnings-filter</a><br>
   ><br>
   > Turn that CLI switch from off to on and I'm pretty sure usage of<br>
   > deprecated things will become pretty evident real quick ;)<br>
<br>
   It needs to be more targetted than that. There is a long standing<br>
   warning between paste and pkg_resources that would hard stop everyone.<br>
<br>
   But, yes, the idea of being able to run unit tests with fatal<br>
   deprecations of oslo easily is what I think would be useful.<br>
             -Sean<br>
<br>
<br>
<br>
In keystone we set a warnings filter for the unit tests so that if keystone<br>
calls any deprecated function it'll raise[1]. So when the oslo timeutils<br>
functions were deprecated it broke keystone gate and we fixed it. It would be<br>
nicer to have a non-voting gate job to serve as a warning instead, but it's<br>
only happened a couple of times where this caused keystone to be blocked for<br>
the day that it took to get the fix in. Anyways, it would be easy enough for us<br>
to have this enabled/disabled via an environment variable and create a tox job.<br>
<br>
If we had a non-voting warning job it could also run oslo libs from master<br>
rather than released.<br>
<br>
[1] <a href="http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/unit/" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/unit/</a><br>
core.py?id=4f8c4a7a10d85080d6db9b30ae1759d45a38a32c#n460<br>
</blockquote>
<br></div></div>
I like this!<br>
<br>
Will look into what needs to be done to make it happen in Glance and<br>
get feedback from the rest of the folks. As you said, it's really few<br>
times when this would totally break a project's gate and I think<br>
that's manageable. <br>
A non-voting gate doesn't have the same effect, FWIW, but I also see<br>
reasons for having one instead of stopping a project.<br>
<br>
Flavio<br>
<br></blockquote><div><br></div><div>If other projects are interested (and since we already copy-pasted it to other keystone projects), I've got a pull request in to fixtures to add a fixture that does the same thing, see <a href="https://github.com/testing-cabal/fixtures/pull/19">https://github.com/testing-cabal/fixtures/pull/19</a> .<br></div><div><br></div><div> - Brant<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
- Brant<br>
<br>
</blockquote><span class="im">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote>
<br>
<br></span><span class=""><font color="#888888">
-- <br>
@flaper87<br>
Flavio Percoco</font></span><div class=""><div class="h5"><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>