Fuel web incompatibility with pytest 2.8

Bug #1497664 reported by Vladimir Sharshov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Critical
Sebastian Kalinowski
7.0.x
Fix Released
Critical
Sebastian Kalinowski

Bug Description

Problem in nailgun/extensions/cluster_upgrade/tests/test_validators.py. For some reason string

```from nailgun.errors import errors``` raise such error with new pytest.

Source: https://github.com/stackforge/fuel-web/blob/master/nailgun/nailgun/extensions/cluster_upgrade/tests/test_validators.py#L22

More details:

ERROR collecting nailgun/extensions/cluster_upgrade/tests/test_validators.py
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/runner.py:149: in __init__
    self.result = func()
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/main.py:437: in _memocollect
    return self._memoizedcall('_collected', lambda: list(self.collect()))
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/main.py:317: in _memoizedcall
    res = function()
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/main.py:437: in <lambda>
    return self._memoizedcall('_collected', lambda: list(self.collect()))
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/python.py:575: in collect
    return super(Module, self).collect()
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/python.py:435: in collect
    l.sort(key=lambda item: item.reportinfo()[:2])
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/python.py:435: in <lambda>
    l.sort(key=lambda item: item.reportinfo()[:2])
nailgun/.tox/py26/lib/python2.6/site-packages/_pytest/python.py:371: in reportinfo
    assert isinstance(lineno, int)
E assert isinstance(<class 'nailgun.errors.compat_co_firstlineno'>, int)

Affect CI jobs: https://ci.fuel-infra.org/job/verify-fuel-web/

Revision history for this message
Vladimir Sharshov (vsharshov) wrote :
Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

It can also affect 7.0 as well.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-web (stable/7.0)

Related fix proposed to branch: stable/7.0
Review: https://review.openstack.org/225497

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/225564

Changed in fuel:
assignee: Vladimir Sharshov (vsharshov) → Sebastian Kalinowski (prmtl)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/225564
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=9757292c3b7f2a8d955fbe2cc1673a2baac702e5
Submitter: Jenkins
Branch: master

commit 9757292c3b7f2a8d955fbe2cc1673a2baac702e5
Author: Sebastian Kalinowski <email address hidden>
Date: Mon Sep 21 09:35:40 2015 +0200

    ErrorsFactory returns only defined errors

    ErrorsFactory had __getattr__ method that was used to always
    return any error (if it doesn't existed, it created a new one).
    This was causing "hasattr" to return 'True' for every check.
    Due to this any code, that wanted to check for some unique attributes
    in ErrorsFactory was working incorrectly. This was the case for
    a py.test library when scannig code when looking for tests.
    Now this behavior has been removed. This uncovered new bugs
    which was fixed.

    Change-Id: I3c9be96dbcc535ea9c730d29b065479cc318fd9f
    Closes-Bug: #1497664

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/7.0)

Fix proposed to branch: stable/7.0
Review: https://review.openstack.org/225683

Changed in fuel:
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/7.0)

Reviewed: https://review.openstack.org/225683
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=52ed7e621cffe8b448b28d3d98a5ec722b75a3e1
Submitter: Jenkins
Branch: stable/7.0

commit 52ed7e621cffe8b448b28d3d98a5ec722b75a3e1
Author: Sebastian Kalinowski <email address hidden>
Date: Mon Sep 21 09:35:40 2015 +0200

    ErrorsFactory returns only defined errors

    ErrorsFactory had __getattr__ method that was used to always
    return any error (if it doesn't existed, it created a new one).
    This was causing "hasattr" to return 'True' for every check.
    Due to this any code, that wanted to check for some unique attributes
    in ErrorsFactory was working incorrectly. This was the case for
    a py.test library when scannig code when looking for tests.
    Now this behavior has been removed. This uncovered new bugs
    which was fixed.

    Change-Id: I3c9be96dbcc535ea9c730d29b065479cc318fd9f
    Closes-Bug: #1497664
    (cherry picked from commit 9757292c3b7f2a8d955fbe2cc1673a2baac702e5)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/7.0)

Change abandoned by Vladimir Sharshov (<email address hidden>) on branch: stable/7.0
Review: https://review.openstack.org/225497
Reason: Final solution: https://review.openstack.org/#/c/225461/,

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (master)

Change abandoned by Vladimir Sharshov (<email address hidden>) on branch: master
Review: https://review.openstack.org/225461
Reason: Final solution: https://review.openstack.org/#/c/225461

Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

https://ci.fuel-infra.org/job/verify-fuel-web/5036/ - according to the last runs, move to fix released

Changed in fuel:
status: Fix Committed → Fix Released
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Dmitry Pyzhov (dpyzhov)
tags: added: tech-debt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.