unity-api-bugs team mailing list archive
-
unity-api-bugs team
-
Mailing list archive
-
Message #06239
[Bug 1376423] Re: There is no easy and future-proof way of starting an app in a clean environment
Closing this as invalid seems a bit premature to me. If possible, a test
should never mess with a production $HOME, but always use a temporary
one. It's safer, allows running the test on a production machine like a
developer's workstation, and also provides better isolation. If your
answer is "well, then always run it on a throwaway phone", I really
doubt that you run your tests very often, as it's just way too
inconvenient to do so.
It's not that hard to set up a temporary session d-bus, upstart, env
variables, and a temp $HOME to run tests in. autopkgtest has a script to
do just that
(http://anonscm.debian.org/cgit/autopkgtest/autopkgtest.git/tree/setup-
commands/ubuntu-touch-session) and it's working quite well. But it would
be nicer to move that to a place where upstream tests can actually use
it, instead of reinventing the wheel every time (and while the resulting
script looks quite simple, it really took me some two hours to figure
this out, as it's not really well documented).
I'm reopening for these reasons. If you still disagree, mark it as
"wontfix" for U-A-L and we'll find another place, but I heavily disagree
on "invalid". It's a very valid concern.
** Changed in: ubuntu-app-launch
Status: Invalid => New
** Summary changed:
- There is no easy and future-proof way of starting an app in a clean environment
+ Provide script to set up a temporary user session
--
You received this bug notification because you are a member of Unity API
bugs, which is subscribed to Ubuntu Application Launcher.
https://bugs.launchpad.net/bugs/1376423
Title:
Provide script to set up a temporary user session
Status in Ubuntu Application Launcher:
New
Bug description:
For manual and automated testing we generally need to be able to start
the applications in a clean environment, in a way that the tests are
not affected by existing files and configurations. And as the tests
should be easily runnable on the devs development machines, the
changes made while running the tests should not affect the real
environment.
In the past we were able to get a reasonably clean environment setting
the value of $HOME to a temporary directory.
Now this is not enough by a variety of reasons, like a hierarchy of
dirs in HOME needed by app armor, apps being launched by upstart, and
services that keep listening to the previous value of HOME.
Every test suite has solved this on it's own why, some use the real
environment but backup the existing files (which is really bad), some
patch the HOME and keep adding details every time something changes,
and some others just pollute the real environment and can't be run on
a dev machine. This is what has been causing failures on the majority
of autopilot tests for the last month.
Instead of keep doing these multiple solutions, and keep adjusting
them every time they stop working; I think we need to find one single
way that works for all the apps. And we need to add automated tests
for this single way to make sure that no new releases will break it.
I'm currently thinking of a testability helper in ubuntu-app-launch
that we call to launch an app and it will make sure that it will start
all the needed XDG vars pointing to a clean temporary environment. We
might still need to restart some services, and we might hit some other
problems, but this is just an idea. Feel free to propose alternatives.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-app-launch/+bug/1376423/+subscriptions
References