https://pulp.plan.io/https://pulp.plan.io/favicon.ico2019-02-26T22:23:38ZPulpPulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=343562019-02-26T22:23:38Zbmbouterbmbouter@redhat.com
<ul><li><strong>Tags</strong> <i>Dev Environment</i> added</li><li><strong>Tags</strong> deleted (<del><i>Pulp 3 installer</i></del>)</li></ul> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=343572019-02-26T22:24:00Zbmbouterbmbouter@redhat.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/34357/diff?detail_id=35045">diff</a>)</li></ul> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=344342019-02-28T22:04:27Zbmbouterbmbouter@redhat.com
<ul><li><strong>Subject</strong> changed from <i>pulplift does not let you run tests with py.test</i> to <i>pulplift does not let you run unit tests with py.test</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/34434/diff?detail_id=35124">diff</a>)</li></ul> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=344382019-03-01T04:45:30ZCodeHeeler
<ul></ul><p>So I did some digging on this and it seems this error may be related to our use of <strong>init</strong>.py files and the way unittest handles them:<br>
<a href="https://code.djangoproject.com/ticket/22280#comment:20" class="external">https://code.djangoproject.com/ticket/22280#comment:20</a></p>
<p>There were several suggested solutions here:<br>
<a href="https://medium.com/@michal.bock/fix-weird-exceptions-when-running-django-tests-f58def71b59a" class="external">https://medium.com/@michal.bock/fix-weird-exceptions-when-running-django-tests-f58def71b59a</a></p>
<p>I tried the one involving nose, which I've used in the past, rather than the code change options but still couldn't get rid of the errors.</p>
<p>I wanted to bounce this off folks before going further as we've had the <strong>init</strong> files a while and I'm not sure how it is broken for you specifically in pulplift only if that's the problem. Does py.test work for you in our old devel way of running vagrant? For that matter, has py.test ever worked for you in our pulplift (want to eliminate the possibility that a recent change caused this)? Thanks!</p> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=344432019-03-01T14:06:34Zdalleydalley@redhat.com
<ul></ul><p>I would say this is expected and not an issue. Django unit tests need a bunch of stuff built up, such as the DB connections, the settings file being parsed, a fresh throwaway test-only database, etc. and py.test doesn't know how to do all of that.</p>
<p>There's extensions that I think will do that, but I haven't really tried. But that's why we've just used the Django unit test runner "./manage.py test <app or directory>.</p>
<p><a href="https://pytest-django.readthedocs.io/en/latest/" class="external">https://pytest-django.readthedocs.io/en/latest/</a></p>
<p>Since the smash tests are run with Pulp running normally in production, they're more independent in this respect, so you've always been able to just use py.test. But not so for unit tests.</p> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=344442019-03-01T14:38:45Zbmbouterbmbouter@redhat.com
<ul></ul><p><a class="user active" href="https://pulp.plan.io/users/349">dalley</a>, thank you for explaining this to me. This makes perfect sense. Do you happen to know if we have this documented anywhere? If not I can rewrite this to be a docs story. If so, then we can close NOTABUG. Thanks!</p> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=344452019-03-01T14:42:11Zbmbouterbmbouter@redhat.com
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>CLOSED - NOTABUG</i></li></ul><p>Actually I see docs here: <a href="https://docs.pulpproject.org/en/3.0/nightly/contributing/dev-setup/runtests.html#running-tests" class="external">https://docs.pulpproject.org/en/3.0/nightly/contributing/dev-setup/runtests.html#running-tests</a></p>
<p>They probably could use some touching up, but they aren't wrong or missing so I'm closing this as NOTABUG.</p> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=412562019-04-25T16:44:13Zdaviddavis
<ul><li><strong>Sprint/Milestone</strong> set to <i>3.0.0</i></li></ul> Pulp - Issue #4481: pulplift does not let you run unit tests with py.testhttps://pulp.plan.io/issues/4481?journal_id=420252019-04-26T20:31:46Zbmbouterbmbouter@redhat.com
<ul><li><strong>Tags</strong> deleted (<del><i>Pulp 3</i></del>)</li></ul>