autopilot: History is not being cleared between tests

Bug #1371219 reported by Omer Akram
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
Fix Released
Undecided
Unassigned

Bug Description

Test are not starting with clean history as a result tests fail because they seem to compare the wrong label. see the failures at:

http://ci.ubuntu.com/smokeng/utopic/touch/mako/245:20140918:20140917/10524/ubuntu_calculator_app/

test-log: {{{
04:53:33.134 WARNING testcase:115 - No tracing available - install the python-autopilot-trace package!
04:53:33.143 WARNING testcase:162 - Process manager backend unavailable, application snapshot support disabled.
04:53:33.193 INFO logging:45 - str: Set the value of an initctl environment variable. Arguments ('/home/phablet/autopilot/fakeenv/tmpp5stumba',).
Keyword arguments: {}.
04:53:33.217 DEBUG __init__:175 - Patched home to fake home directory /home/phablet/autopilot/fakeenv/tmpp5stumba
04:53:33.220 INFO logging:45 - TestSimplePage: launch_test_click. Arguments (). Keyword arguments: {}.
04:53:33.221 INFO _launcher:280 - Attempting to launch click application '(default)' from click package 'com.ubuntu.calculator' and URIs ''
04:53:34.031 INFO _launcher:120 - Attempting to launch application 'com.ubuntu.calculator_calculator_1.3.329' with URIs '' via upstart-app-launch
04:53:39.791 DEBUG __init__:202 - Pressing 4 button
04:53:39.869 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:39.870 DEBUG _uinput:497 - Pressing at: 136,963
04:53:39.921 DEBUG _uinput:506 - Releasing
04:53:40.096 DEBUG __init__:202 - Pressing + button
04:53:40.213 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:40.214 DEBUG _uinput:497 - Pressing at: 631,963
04:53:40.275 DEBUG _uinput:506 - Releasing
04:53:40.438 DEBUG __init__:202 - Pressing 2 button
04:53:40.492 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:40.493 DEBUG _uinput:497 - Pressing at: 301,1083
04:53:40.581 DEBUG _uinput:506 - Releasing
04:53:40.717 DEBUG __init__:202 - Pressing . button
04:53:40.771 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:40.772 DEBUG _uinput:497 - Pressing at: 466,1203
04:53:40.840 DEBUG _uinput:506 - Releasing
04:53:41.001 DEBUG __init__:202 - Pressing 5 button
04:53:41.123 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:41.124 DEBUG _uinput:497 - Pressing at: 301,963
04:53:41.188 DEBUG _uinput:506 - Releasing
04:53:41.341 DEBUG __init__:202 - Pressing 5 button
04:53:41.447 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:41.449 DEBUG _uinput:497 - Pressing at: 301,963
04:53:41.522 DEBUG _uinput:506 - Releasing
04:53:41.567 INFO logging:45 - CalcKeyboard: Click the equals button. Arguments (). Keyword arguments: {}.
04:53:41.711 DEBUG __init__:202 - Pressing = button
04:53:41.785 DEBUG _common:45 - Moving to object's globalRect coordinates.
04:53:41.786 DEBUG _uinput:497 - Pressing at: 631,1143
04:53:41.873 DEBUG _uinput:506 - Releasing
04:53:41.876 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:41.987 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:42.432 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:43.654 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:43.901 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:44.334 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:45.580 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:45.727 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:46.148 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:47.375 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:47.525 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:47.947 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:49.167 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:49.340 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:49.808 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:51.034 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:51.192 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:51.632 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:52.881 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:53.027 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:53.490 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:54.738 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:54.893 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:55.333 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:56.565 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:56.715 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:57.140 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:53:58.365 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:58.501 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:53:58.942 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:54:00.186 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:54:00.339 DEBUG dbus:352 - Selecting objects of type Screen with attributes: {}
04:54:00.778 DEBUG dbus:352 - Selecting objects of type CalcLabel with attributes: {'objectName': 'result'}
04:54:02.123 INFO logging:45 - str: Set the value of an initctl environment variable. Arguments ('/home/phablet',). Keyword arguments: {}.
}}}

Traceback (most recent call last):
  File "/home/phablet/autopilot/ubuntu_calculator_app/tests/test_simple_page.py", line 98, in test_addition
    self._assert_result("6.55")
  File "/home/phablet/autopilot/ubuntu_calculator_app/tests/test_simple_page.py", line 35, in _assert_result
    self.app.main_view.get_result, Eventually(Equals(expected_result)))
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 423, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: After 10.0 seconds test failed: '6.55' != '14'

Related branches

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Just so this is reflected here; the tests could/should be updated to only look at the right label.

However, this failure occurs because the environment is not clean during test runs as it should be. Something is failing with the mocking.

Changed in ubuntu-calculator-app:
status: New → 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.