tools/check_uuid.py works incorect for tests with decorators

Bug #1431267 reported by Yaroslav Morkovnikov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Marc Koderer

Bug Description

There is a patch
https://review.openstack.org/#/c/153234/

It contains new tests as well as DDT lib enabling. In case of DDT test uses decorators. In that case tools/check_uuid.py does not check test ids correctly. I see following

tox -v -epep8
using tox.ini: /home/ymorkovn/tempest/tox.ini
using tox-1.9.0 from /usr/local/lib/python2.7/dist-packages/tox/__init__.pyc
pep8 reusing: /home/ymorkovn/tempest/.tox/pep8
  /home/ymorkovn/tempest$ /home/ymorkovn/tempest/.tox/pep8/bin/python /home/ymorkovn/tempest/setup.py --name
pep8 develop-inst-noop: /home/ymorkovn/tempest
pep8 runtests: PYTHONHASHSEED='378892151'
pep8 runtests: commands[0] | flake8
  /home/ymorkovn/tempest$ /home/ymorkovn/tempest/.tox/pep8/bin/flake8
pep8 runtests: commands[1] | /home/ymorkovn/tempest/tools/config/check_uptodate.sh
  /home/ymorkovn/tempest$ /home/ymorkovn/tempest/tools/config/check_uptodate.sh
pep8 runtests: commands[2] | python tools/check_uuid.py
  /home/ymorkovn/tempest$ /home/ymorkovn/tempest/.tox/pep8/bin/python tools/check_uuid.py
2015-03-12 10:18:23.199 31877 CRITICAL tempest [-] AttributeError: 'Name' object has no attribute 'attr'
2015-03-12 10:18:23.199 31877 TRACE tempest Traceback (most recent call last):
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 354, in <module>
2015-03-12 10:18:23.199 31877 TRACE tempest run()
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 342, in run
2015-03-12 10:18:23.199 31877 TRACE tempest untagged = checker.find_untagged(tests)
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 260, in find_untagged
2015-03-12 10:18:23.199 31877 TRACE tempest return self._filter_tests(check_uuid_in_meta, tests)
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 242, in _filter_tests
2015-03-12 10:18:23.199 31877 TRACE tempest if function(module_name, test_name, tests):
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 258, in check_uuid_in_meta
2015-03-12 10:18:23.199 31877 TRACE tempest tests[module_name]['tests'][test_name])
2015-03-12 10:18:23.199 31877 TRACE tempest File "tools/check_uuid.py", line 122, in _get_idempotent_id
2015-03-12 10:18:23.199 31877 TRACE tempest decorator.func.attr == DECORATOR_NAME and
2015-03-12 10:18:23.199 31877 TRACE tempest AttributeError: 'Name' object has no attribute 'attr'
2015-03-12 10:18:23.199 31877 TRACE tempest
ERROR: InvocationError: '/home/ymorkovn/tempest/.tox/pep8/bin/python tools/check_uuid.py'
Add tags Tag help
See full activity log
Add comment

Changed in tempest:
assignee: nobody → Chris Hoge (hoge)
Revision history for this message
Marc Koderer (m-koderer) wrote :

@Chris: Ups, I think I already fixed the issue without seeing this bug.
Could you have a look? Sry for "stealing" it...
I will link the patch to this bug then (it's https://review.openstack.org/#/c/164647/).

Changed in tempest:
assignee: Chris Hoge (hoge) → Marc Koderer (m-koderer)
status: New → In Progress
Revision history for this message
Yaroslav Morkovnikov (ymorkovn) wrote :

For me it works

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/164647
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=fb199c05168a88b37d1d0d09e53beccf78b88e6b
Submitter: Jenkins
Branch: master

commit fb199c05168a88b37d1d0d09e53beccf78b88e6b
Author: Marc Koderer <email address hidden>
Date: Mon Mar 16 11:53:44 2015 +0100

    Add additional checks for attributes

    Some decorators (like dtt) do have a func attribute
    but no "attr" and "value" attribute defined.
    This leads to errors during pep8 gate check (see [1]).

    [1]: https://review.openstack.org/#/c/153234/4

    Closes-Bug: #1431267
    Change-Id: Id16bce40e30ecb6bc5bff9b55650acc538ece3a9

Changed in tempest:
status: In Progress → Fix Released
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.