Production code must not import from neutron.tests.*

Bug #1621782 reported by Ihar Hrachyshka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Ihar Hrachyshka

Bug Description

sanity-check tool for one imports some util functions from neutron.tests.base. This makes distributions that split out tests subtree in a separate package somewhat broken.

It's my belief we should really enforce the requirement via hacking check, otherwise we will hit similar issues in the future.

Changed in neutron:
milestone: none → newton-rc1
Changed in neutron:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
status: New → In Progress
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :
Changed in neutron:
importance: Undecided → Low
Changed in neutron:
milestone: newton-rc1 → ocata-1
tags: added: newton-rc-potential
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

I'd say that this is high, because all things staying equal if we break distros there's no remedy actions but reverting the culprit that caused the snafus.

Changed in neutron:
milestone: ocata-1 → newton-rc2
importance: Low → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/367340
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=31e1aeb66b2d8abb0d8424e9550693fad6f37c1c
Submitter: Jenkins
Branch: master

commit 31e1aeb66b2d8abb0d8424e9550693fad6f37c1c
Author: Ihar Hrachyshka <email address hidden>
Date: Tue Aug 30 10:42:41 2016 +0000

    Forbid importing neutron.tests.* from outside tests subtree

    neutron-sanity-check tool was importing neutron.tests.base module, which
    may be not present on some systems (f.e. RDO splits neutron/tests/
    subtree in a separate python-neutron-tests package). It made the tool
    not usable in some setups.

    https://bugzilla.redhat.com/show_bug.cgi?id=1374282

    This is not the first time when we by mistake import from
    neutron.tests.* and break distributions. It's time to stop it by
    proactively forbidding that pattern via a new hacking check.

    Some functions were moved from neutron.tests.base to
    neutron.common.utils to fulfill the need requirement. They were moved
    using debtcollector, no current consumers should be affected.

    Closes-Bug: #1621782
    Change-Id: I790777ddcbd1b02218b3db54ae3d5c931d72d4fa

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/372822

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/372822
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ea8a1451b83090c2c6a21c605922d16820e64b30
Submitter: Jenkins
Branch: stable/newton

commit ea8a1451b83090c2c6a21c605922d16820e64b30
Author: Ihar Hrachyshka <email address hidden>
Date: Tue Aug 30 10:42:41 2016 +0000

    Forbid importing neutron.tests.* from outside tests subtree

    neutron-sanity-check tool was importing neutron.tests.base module, which
    may be not present on some systems (f.e. RDO splits neutron/tests/
    subtree in a separate python-neutron-tests package). It made the tool
    not usable in some setups.

    https://bugzilla.redhat.com/show_bug.cgi?id=1374282

    This is not the first time when we by mistake import from
    neutron.tests.* and break distributions. It's time to stop it by
    proactively forbidding that pattern via a new hacking check.

    Some functions were moved from neutron.tests.base to
    neutron.common.utils to fulfill the need requirement. They were moved
    using debtcollector, no current consumers should be affected.

    Closes-Bug: #1621782
    Change-Id: I790777ddcbd1b02218b3db54ae3d5c931d72d4fa
    (cherry picked from commit 31e1aeb66b2d8abb0d8424e9550693fad6f37c1c)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0rc2

This issue was fixed in the openstack/neutron 9.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/379803

tags: removed: newton-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b1

This issue was fixed in the openstack/neutron 10.0.0.0b1 development milestone.

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

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/379803
Reason: This review is > 4 weeks without comment and currently blocked by a core reviewer with a -2. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and contacting the reviewer with the -2 on this review to ensure you address their concerns.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/379803
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=bea8985d78e6925874d2645c7ef82f765799df6e
Submitter: Jenkins
Branch: master

commit bea8985d78e6925874d2645c7ef82f765799df6e
Author: Dariusz Smigiel <email address hidden>
Date: Thu Sep 29 20:18:29 2016 +0000

    Removed deprecated tests function

    Change I790777ddcbd1b02218b3db54ae3d5c931d72d4fa deprecated functions:
    get_related_rand_names, get_rand_name, get_rand_device_name,
    get_related_rand_device_names in neutron.tests.* to allow separation of neutron
    code and neutron tests.

    Change-Id: I04e2fb87572d825fa736c66266dc6ec9855b93f9
    Related-Bug: #1621782

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.