in autopilot tests, UnityTestCase setup is too big and complicated

Bug #1447206 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity8 (Ubuntu)
Fix Released
Medium
Unassigned
Vivid
New
Undecided
Unassigned

Bug Description

The UnityTestCase setup in autopilot tests does a lot of things to prepare the environment and it has some conditionals to change the behaviour depending on the tests being run.

This makes the setup too complicated and hard to reuse in other tests. If we inherit from that test case, we inherit the setup, so this it's not a good base to start new tests.

An alternative is to write the setup as multiple fixtures, one per each environment detail we need. Fixtures allow to extend test cases by composition, so you choose the parts you want in each test, making the environment clearer.

Related branches

Revision history for this message
Leo Arias (elopio) wrote :

Currently the fake sensors setup is implemented as one big fixture.
This duplicates some of the code in the base test case setup. We should extract some parts of the fake sensors setup into a base fixture, and use it in the base class.

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.02+15.04.20150511-0ubuntu1

---------------
unity8 (8.02+15.04.20150511-0ubuntu1) vivid; urgency=medium

  [ Albert Astals Cid ]
  * Workarounds for concierge mode.

  [ CI Train Bot ]
  * New rebuild forced.
  * Resync trunk.

unity8 (8.02+15.04.20150505-0ubuntu1) vivid; urgency=medium

  [ Albert Astals Cid ]
  * Make runtests fake a test error if make fails
  * Make the test more stable
  * Use dbus-test-runner instead of dbus-launch

  [ Daniel d'Andrada ]
  * DirectionalDragArea: improvements & API grooming (LP: #1417920)
  * Fix EdgeDragEvaluator when a drag can happen both ways
    (Direction.Horizontal)

  [ Josh Arenson ]
  * Remove panelHeight property as it is unused.

  [ Leo Arias ]
  * Initial clean up of the autopilot tests set up. Removed the touch
    device from the test case. Moved the restart of unity to a fixture.
    Removed the unused DragMixin. Updated the setUpClass to use
    process_helpers. Removed the workaround for bug #1238417, already
    fixed. Use the toolkit helper to set the testability environment
    variable. Fixed the indicators base class that was restarting unity
    twice. (LP: #1238417, #1447206)
  * Use the base class from the toolkit in autopilot tests.

  [ Michael Zanetti ]
  * emit application-stop when we're going down (LP: #1326513)

  [ Michał Sawicz ]
  * UNITY_SCOPES_LIST is no more

  [ handsome_feng<email address hidden> ]
  * When click the favorite scope in Dash Manager , it just return to
    the corresponding scope page. (LP: #1447056)

unity8 (8.02+15.04.20150422-0ubuntu1) vivid; urgency=medium

  [ Albert Astals Cid ]
  * Compile with Qt 5.5 (LP: #1437238)
  * Different way of top aligning labels when the other one in the row
    is multiline (LP: #1442085)
  * make pot_file

  [ Andrea Cimitan ]
  * Set sourceSize for DashBackground.qml Image

  [ CI Train Bot ]
  * New rebuild forced.
  * Resync trunk. added: po/sk.po

  [ Daniel d'Andrada ]
  * Move handling of command line options to a separate class
  * Refactor tst_PhysicalKeysMapper.qml

  [ Leo Arias ]
  * For autopilot tests, use the device simulation scenarios from the
    toolkit.

  [ Leonardo Arias Fonseca ]
  * For autopilot tests, use the device simulation scenarios from the
    toolkit.

  [ Michael Zanetti ]
  * Make sure dnd mode is ended properly when drag gesture is cancelled
    (LP: #1444949)

  [ Michał Sawicz ]
  * Fix flake8 warnings (LP: #1444170)
  * Move mock indicator service to unity8-fake-env, as it's a binary-
    dependent package.

  [ Nick Dedekind ]
  * Use asynchronous dbus requests for property updates. (LP: #1436982)

 -- CI Train Bot <email address hidden> Mon, 11 May 2015 08:29:58 +0000

Changed in unity8 (Ubuntu):
status: Triaged → 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.