Provide script to set up a temporary user session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Autopilot |
New
|
Undecided
|
Unassigned | ||
Ubuntu Touch session manager |
New
|
Undecided
|
Unassigned |
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.
Changed in ubuntu-app-launch: | |
assignee: | nobody → Martin Pitt (pitti) |
Changed in ubuntu-touch-session: | |
assignee: | Martin Pitt (pitti) → nobody |
<elopio> ping ted. /bugs.launchpad .net/ubuntu- app-launch/ +bug/1376423
<elopio> do you have some time to talk again about a temp home dir?
<elopio> https:/
<ubot5> Ubuntu bug 1376423 in Ubuntu Application Launcher "There is no easy and future-proof way of starting an app in a clean environment" [Undecided,New]
<ted> pong elopio
<elopio> ubuntu-qa, thomi and balloons: ^ feel free to also comment that bug.
<ted> I kinda disagree with your statement there.
<ted> "In the past we were able to get a reasonably clean environment setting the value of $HOME to a temporary directory."
<ted> That was always a bad idea.
<ted> elopio, Why can't you just wipe the device for a clean environment?
<elopio> ted: that's clear for me now.
<ted> That's really the only way it's really "clean"
<elopio> ted: we are not always testing on phones, we also need to test on dev machines.
<dobey> hmm
<elopio> ted: and some of the devices we are using are also the ones we dogfood.
<ted> elopio, Okay, in a container.
<elopio> it's bad to have to reset them every time.
<ted> elopio, dog fooded devices can't ever be clean.
<elopio> ted: a container can be a good solution.
<ted> I'm hoping people don't use that for real testing.
<elopio> ted: not for something like running the whole suite to decide if a version is promoted or not.
<elopio> but we need to use the dogfooding devices to check that a new test we added works.
<elopio> or to debug a test that started failing.
<elopio> otherwise we would need two devices. Of every model.
<ted> But, you'll need to wipe it to land the silo with the new test, no?
-*- balloons settles in
<ted> So you kinda need a device you can wipe of every model you care about.
<elopio> ted: that's for the silo testers.
<ted> Don't we silo MRs for tests?
<elopio> they are not necessarily the same as the dogfooders or automation devs.
<balloons> ted, we do need a way to run tests sanely as a developer or test writer too
<ted> Sure, but those folks don't need a clean test environment either.
<elopio> ted: I didn't get that last question. But I think you would agree that any solution we find, needs to be easily runnable from a dev machine. Do we agree there?
<balloons> but you can argue about whether the test or the test harness should prep the environment
<ted> I'm just saying that we're not going to get "clean" on a device that isn't wiped.
<ted> It's always going to be sullied in some way.
<elopio> ted: maybe we could get a container on a device that is not wiped
<ted> Or there's enough of a chance that it could be that it's not a "result" just a checkup.
<balloons> at the very least the test shouldn't be polluting, while still allow us to setup at least the parts we are responsible for correctly
<elopio> and generally we will run on an unwiped device just a small subset of tests.
<elopio> maybe for that case we don't need a perfectly clean environment. Just something that doesn't delete all the photos I took yesterday.
<ted> Sure, the testing shouldn't be destructive.
<dobey> elopio: can you not run the tests in a schroot?
<elopio> ted: but we need to test the behavior of the gallery app without existing tests. So we need to have an environment that temp...