← Back to team overview

unity-dev team mailing list archive

[ANNOUNCE] unity-autopilot-wrapper - Run autopilot tests headless or in xephyr without messing up your session

 

Hey unity (7.0) hackers,

I put together something this weekend that I thought people might find
useful if they're running autopilot tests.

unity-autopilot-wrapper is effectively a Google Test
::testing::Environment (with a few other related tools) which will
allow you to spawn a self-contained instance of Unity in a headless X
Server or Xephyr using the ubuntu default settings. This should make
it a lot easier to run those tests should you need to do so without
having to worry about changing all the settings back to their defaults
and closing open windows etc.

Currently, its features are:
 * - Spawns a new dbus-session bus and exports its address as the one
to use for the test
 * - Spawns a headless X Server or Xephyr
 * - Spawns compiz inside of that, connected to the new dbus session
(this in turn causes fresh instances of bamfdaemon,
unity-panel-service, hud-service, lenses, etc to spawn just for that
dbus session).
 * - Enumerates through the available autopilot tests and runs each
autopilot test as a separate test in the Google Test binary (so you
can track the progress of the tests)
 * - Allows filtering through those tests on startup (so you can just
run one autopilot test in a self-contained session to check it
quickly)
 * - Allows you to specify a custom compizconfig profile to load,
compiz binary to launch and even where compiz plugins should be loaded
from, so you don't have to use the installed compiz and unity to run
the tests.
 * - A sample of the environment can be installed and run from
anywhere, which runs all the autopilot tests installed inside of a
Xephyr window. Perhaps ideal for autopkgtests.

The source code can be found at my GitHub repository:
 * - git://github.com/smspillaz/unity-autopilot-wrapper

At the moment, there isn't an ubuntu package. I'd like to do a daily
build, but launchpad imports don't work with git repositories that
have submodules and this one does. Perhaps I'll get a PPA up and
running soon enough.

Caveats:
 * - It renders using llvmpipe which is pretty CPU heavy. I've not
been able to complete a whole run of the tests without heat problems
on my machine. YMMV.
 * - There may be *some* false negatives. I've seen a few failures but
so far I've been able to reproduce them in a real session too.
 * - Xephyr seems to create two windows at the moment. Not sure why,
just minimize the other one.

Screenshot, in case anybody is interested:
http://www.ucc.asn.au/~smspillaz/autopilot-xephyr.png

Best,

Sam

--
Sam Spilsbury


Follow ups