Code review comment for lp:~psusi/landscape-client/correct-free-mem

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

There are a bunch of test failures, can you take a look at those?

[FAIL]
Traceback (most recent call last):
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/mocker.py", line 146, in test_method_wrapper
    result = test_method()
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/lib/tests/test_sysstats.py", line 42, in test_get_memory_info
    self.assertEqual(memstats.free_memory, 503)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/unittest.py", line 271, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = 852
b = 503

landscape.lib.tests.test_sysstats.MemoryStatsTest.test_get_memory_info
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/mocker.py", line 146, in test_method_wrapper
    result = test_method()
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/monitor/tests/test_memoryinfo.py", line 154, in test_exchange_messages
    (step_size * 2, 503, 1567)]}])
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/helpers.py", line 82, in assertMessages
    self.assertMessage(obtained_message, expected_message)
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/helpers.py", line 76, in assertMessage
    pprint.pformat(obtained)))
twisted.trial.unittest.FailTest: Messages don't match.
Expected:
{'memory-info': [(300, 503, 1567), (600, 503, 1567)], 'type': 'memory-info'}
Obtained:
{'memory-info': [(300, 852, 1567), (600, 852, 1567)], 'type': 'memory-info'}

landscape.monitor.tests.test_memoryinfo.MemoryInfoTest.test_exchange_messages
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/mocker.py", line 146, in test_method_wrapper
    result = test_method()
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/monitor/tests/test_memoryinfo.py", line 78, in test_read_sample_data
    self.assertEqual(message["memory-info"][0], (step_size, 503, 1567))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/unittest.py", line 271, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = (300, 852, 1567)
b = (300, 503, 1567)

landscape.monitor.tests.test_memoryinfo.MemoryInfoTest.test_read_sample_data
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/tests/mocker.py", line 146, in test_method_wrapper
    result = test_method()
  File "/home/andreas/canonical/source/landscape-client/psusi/correct-free-mem/landscape/sysinfo/tests/test_memory.py", line 53, in test_run_adds_header
    ("Swap usage", "39%")])
  File "/usr/lib/python2.7/dist-packages/twisted/trial/unittest.py", line 271, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = [('Memory usage', '27%'), ('Swap usage', '39%')]
b = [('Memory usage', '34%'), ('Swap usage', '39%')]

landscape.sysinfo.tests.test_memory.MemoryTest.test_run_adds_header
-------------------------------------------------------------------------------
Ran 2168 tests in 176.331s

FAILED (skips=7, failures=4, successes=2157)

You can run the test suite with "trial landscape" inside the root of the ckeckout directory. You may need to install some extra packages.
Here is a list taken from one of our setup scripts. It may install more than you need, but it's a place to start if you get test errors due to missing packages:
function install_common_dev_tools {
    apt_get install --no-install-recommends \
        build-essential \
        gcc \
        python-dev \
        bzr \
        bzrtools \
        exuberant-ctags \
        pyflakes \
        debhelper \
        fakeroot \
        devscripts \
        dput \
        xvfb
}

function install_client_deps {
    # Notes:
    # - libgudev-1.0-dev supposed to take care of gir1.*-gudev* deps.
    # - hal/smart needed for client tests, even though they are optional
    # on modern ubuntu releases
    apt_get install --no-install-recommends \
        acct \
        python-dbus \
        python-gdbm \
        python-gobject \
        python-twisted-core \
        python-twisted-names \
        python-lxml \
        python-apt \
        python-openssl \
        libgudev-1.0-dev \
        lsb-release \
        perl-modules \
        python-pycurl \
        hal \
        python-smartpm \
        python-distutils-extra \
        $GIR \

GIR is "gir1.2-gtk-3.0 gir1.2-notify-0.7"

« Back to merge proposal