unit tests need improvement

Bug #880961 reported by Paul Larson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Obsolete LAVA Test
Fix Released
Undecided
Unassigned

Bug Description

When trying to build a package for lava-test, I hit the following error:

======================================================================
ERROR: test_get_usb_devs (tests.test_hwprofile.HwprofileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/buildd/lava-test-0.3.1/tests/test_hwprofile.py", line 143, in test_get_usb_devs
    self.assertEqual('device.usb', devs[0]['device_type'])
IndexError: list index out of range

----------------------------------------------------------------------
Ran 30 tests in 2.225s

Additionally, trying to run the tests without lava-test being installed seems to give the following:
running=PYTHONPATH=. python -m subunit.run tests.test_suite| testr load
======================================================================
ERROR: tests.test_lavatest_commands.ListInstalled.test_list_installed
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "tests/test_lavatest_commands.py", line 50, in test_list_installed
    self._runLavaTest(['list-installed'])
  File "tests/test_lavatest_commands.py", line 28, in _runLavaTest
    LAVATestDispatcher().dispatch(cmds)
  File "/home/plars/.local/lib/python2.7/site-packages/lava_tool-0.2-py2.7.egg/lava_tool/dispatcher.py", line 67, in dispatch
    args = self.parser.parse_args(raw_args)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1698, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1733, in parse_known_args
    self.error(str(err))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2353, in error
    self.exit(2, _('%s: error: %s\n') % (self.prog, message))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2341, in exit
    _sys.exit(status)
SystemExit: 2
------------
======================================================================
ERROR: tests.test_lavatest_commands.ListInstalled.test_run_command_test_not_exist
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "tests/test_lavatest_commands.py", line 54, in test_run_command_test_not_exist
    self._runLavaTest(['run','abc'])
  File "tests/test_lavatest_commands.py", line 28, in _runLavaTest
    LAVATestDispatcher().dispatch(cmds)
  File "/home/plars/.local/lib/python2.7/site-packages/lava_tool-0.2-py2.7.egg/lava_tool/dispatcher.py", line 67, in dispatch
    args = self.parser.parse_args(raw_args)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1698, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1733, in parse_known_args
    self.error(str(err))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2353, in error
    self.exit(2, _('%s: error: %s\n') % (self.prog, message))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2341, in exit
    _sys.exit(status)
SystemExit: 2
------------
======================================================================
ERROR: tests.test_lavatest_commands.ListKnown.test_list_tests
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "tests/test_lavatest_commands.py", line 42, in test_list_tests
    self._runLavaTest(['list-tests'])
  File "tests/test_lavatest_commands.py", line 28, in _runLavaTest
    LAVATestDispatcher().dispatch(cmds)
  File "/home/plars/.local/lib/python2.7/site-packages/lava_tool-0.2-py2.7.egg/lava_tool/dispatcher.py", line 67, in dispatch
    args = self.parser.parse_args(raw_args)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1698, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/pymodules/python2.7/argparse.py", line 1733, in parse_known_args
    self.error(str(err))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2353, in error
    self.exit(2, _('%s: error: %s\n') % (self.prog, message))
  File "/usr/lib/pymodules/python2.7/argparse.py", line 2341, in exit
    _sys.exit(status)
SystemExit: 2
------------
id=0, tests=30, failures=3

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Works for me on lp:lava-test rev 105

Changed in lava-test:
status: New → Fix Released
milestone: none → 2011.12
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.