]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
oe-selftest: fix handling of test cases without ID in --list-tests-by
authorMaciej Borzecki <maciej.borzecki@rndity.com>
Thu, 10 Nov 2016 12:18:37 +0000 (13:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Nov 2016 15:18:50 +0000 (15:18 +0000)
commit71c6790689e2cbd3c4e882335b3b03e635ad46ed
tree83db58105502681dcf9759b3319fb63d41a56996
parentf5bf7bf253224912c66bab89f48ff63a73e0d698
oe-selftest: fix handling of test cases without ID in --list-tests-by

Running `oe-selftest --list-tests-by module wic` will produce the
following backtrace:

Traceback (most recent call last):
  File "<snip>/poky/scripts/oe-selftest", line 668, in <module>
    ret = main()
  File "<snip>/poky/scripts/oe-selftest", line 486, in main
    list_testsuite_by(criteria, keyword)
  File "<snip>/poky/scripts/oe-selftest", line 340, in list_testsuite_by
    ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) for tc in get_testsuite_by(criteria, keyword) ])
TypeError: unorderable types: int() < NoneType()

The root cause is that a test case does not necessarily have an ID
assigned, hence its value is None. Since Python 3 does not allow
comparison of heterogeneous types, TypeError is raised.

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-selftest