Closed
Bug 1028941
Opened 11 years ago
Closed 11 years ago
Only kill ftu instead of all in setUp
Categories
(Firefox OS Graveyard :: Gaia::UI Tests, defect)
Tracking
(b2g-v2.0 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
b2g-v2.0 | --- | fixed |
People
(Reporter: zcampbell, Assigned: zcampbell)
References
Details
Attachments
(1 file)
The Gaia team are getting more adventurous with open/background/partially open apps, for example OperatorVariant, Call screen, Search collections etc.
Let's experiment with adapting the GaiaTestCase setUp to only kill the FTU just to be sure we're not accidentally killing any important or newly added apps with kill_all.
Assignee | ||
Comment 1•11 years ago
|
||
Instead of kill_all, do [pseudo-code] "if FTU in self.apps.running_apps: self.apps.kill(FTU)"
Assignee | ||
Comment 2•11 years ago
|
||
Or ignore comment #1, do whatever solution you feel is best. The kill method only accepts a GaiaApp object which limits it a bit.
Comment 3•11 years ago
|
||
The point of setUp is to restore to a known state. If we only kill FTU then we may leave applications open from a previous test, which could invalidate the current test.
Assignee | ||
Comment 4•11 years ago
|
||
Ok that's true. That workflow we can cover by keeping keep kill_all inside the cleanup_gaia method.
I am just wary of messing with Gaia too much. Especially as some of the new homescreen is integrated as always-running apps and it's hard to keep the killAll atom up to date with what's supposed to be open and what's not.
I wonder if there's a way to detect from the AppWindowManager whether the app should be kept alive or not.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → zcampbell
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8447104 -
Flags: review?(florin.strugariu)
Assignee | ||
Comment 6•11 years ago
|
||
adhoc +smoketest run:
http://selenium.qa.mtv2.mozilla.com:8080/job/b2g.flame.mozilla-central.ui.adhoc/41/
Comment 7•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
TBPL is still failing
Attachment #8447104 -
Flags: review?(florin.strugariu) → review-
Assignee | ||
Comment 8•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
Ran into problems in the unit tests because now running_apps is returning the correct apps!
Dave and I also discussed making kill all only kill user-killable apps and I got this data from the StackManager (cards view).
There's now a disparity between the kill_all and what running_apps returns which might seem odd at first but makes sense once you understand the distinction between all apps and the user-killable apps.
I've updated the test_kill* unit tests to reflect this.
We still need running_apps to return all apps so that we can detect when the FTU is running.
Attachment #8447104 -
Flags: review?(florin.strugariu)
Attachment #8447104 -
Flags: review?(dave.hunt)
Attachment #8447104 -
Flags: review-
Comment 9•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
I think we need to be consistent in the atom when we're talking about all apps or only apps that can be closed by a user. At the moment getRunningApps, numRunningApps, and killAll are not consistent.
We could perhaps pass an optional boolean to the JavaScript functions to indicate if we want to include the apps that users can't close. Something like includeSystemApps, perhaps?
Also, requesting feedback from Alive on the safety of using window.wrappedJSObject.StackManager._stack
Attachment #8447104 -
Flags: review?(dave.hunt)
Attachment #8447104 -
Flags: review-
Attachment #8447104 -
Flags: feedback?(alive)
Comment 10•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
I dare not to say this is correct or not.
The stack is not including:
* Homescreen
* Callscreen
* Secure camera app on Lockscreen
BTW why do you need to change this?
What's the benefit?
Assignee | ||
Comment 11•11 years ago
|
||
Alive, we want to exclude killing important System apps like Homescreen, callscreen, lockscreen, collections etc.
I became concerned that the test suite was too aggressive and may kill some important apps and then cause Gaia to misbehave.
However we still need to cleanup Gaia after tests so we need to know which apps are safe to kill and which ones are not. Gaia does know this because it is able to exclude some apps from the Cards View.
Comment 12•11 years ago
|
||
Code looks OK
And travis passes. I ran a addhoc http://selenium.qa.mtv2.mozilla.com:8080/job/b2g.flame.mozilla-central.ui.adhoc/42
Assignee | ||
Comment 13•11 years ago
|
||
@Alive, I looked through AppWindowManager to find a property that defined whether it was user-killable or a protected system window but I could not find one. Does AWM not expose this information?
That's why I ended up using this stack array.
Flags: needinfo?(alive)
Comment 14•11 years ago
|
||
Zac, thanks for explanation.
I am a little confused why we don't just restart the b2g instance after each test.
Does comment 11 means if the test is to test homescreen then the homescreen app will remain its state until the tests are all ended?
Flags: needinfo?(alive)
Comment 15•11 years ago
|
||
(In reply to Zac C (:zac) from comment #13)
> @Alive, I looked through AppWindowManager to find a property that defined
> whether it was user-killable or a protected system window but I could not
> find one. Does AWM not expose this information?
Right, because this is not a feature requested before. There's no 'close all apps' UI to go.
Assignee | ||
Comment 16•11 years ago
|
||
(In reply to Alive Kuo [:alive][NEEDINFO!] from comment #14)
> Zac, thanks for explanation.
> I am a little confused why we don't just restart the b2g instance after each
> test.
>
90% of the time we do just restart, but some partners and non-functional test suites use this framework and they prefer not to restart for their particular test case.
> Does comment 11 means if the test is to test homescreen then the homescreen
> app will remain its state until the tests are all ended?
Yes, basically.
Thanks for your help, I'll tidy up this pull a bit when I get a chance.
Comment 17•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
f+ if you use snapshot()
Attachment #8447104 -
Flags: feedback?(alive) → feedback+
Assignee | ||
Comment 18•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
re-r?
Attachment #8447104 -
Flags: review- → review?(dave.hunt)
Assignee | ||
Comment 19•11 years ago
|
||
Also retriggered an adhoc
http://selenium.qa.mtv2.mozilla.com:8080/job/b2g.flame.mozilla-central.ui.adhoc/49/
Assignee | ||
Comment 20•11 years ago
|
||
I'll also add that I did experiment with adding a unit test for killAll including system apps but sometimes the homescreen did not re-start properly and I did not trust that it would be stable. I really think that killing system apps should not be used if it can be avoided, but I've included it as a capability in the atom for consistency.
Comment 21•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
Sorry, I don't really have enough time before PTO to give this the attention it deserves. I had a quick look through and in general it looks good, however I'd prefer docstrings to be used for methods rather than line comments.
Also, this will have an effect on Eideticker, b2gperf, and probably other consumers. As far as I can tell FTU is considered a system app, and therefore will not be killed using kill_all(), which is currently expected. Is there a way to consider this a user killable app, as we know it's safe to kill?
Attachment #8447104 -
Flags: review?(dave.hunt)
Assignee | ||
Comment 22•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
docstrings are easy to fix.
I'll r? bsilverberg on it.
No huge rush Bob.
Attachment #8447104 -
Flags: review?(bob.silverberg)
Assignee | ||
Comment 23•11 years ago
|
||
I've put kill FTU into the kill_all method so that consumers won't have to change their setUp.
Comment 24•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
A couple of code changes are required to make the code work. Other than that it looks good to me. I made a number of comments that can be taken or not.
Attachment #8447104 -
Flags: review?(bob.silverberg) → review-
Assignee | ||
Comment 25•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
r? again
Attachment #8447104 -
Flags: review- → review?(bob.silverberg)
Comment 26•11 years ago
|
||
Comment on attachment 8447104 [details] [review]
github pr
Looks good now. Just remove the one extraneous comment.
Attachment #8447104 -
Flags: review?(bob.silverberg) → review+
Assignee | ||
Updated•11 years ago
|
Attachment #8447104 -
Flags: review?(florin.strugariu)
Assignee | ||
Comment 27•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 28•11 years ago
|
||
Uplifted to v2.0:
https://github.com/mozilla-b2g/gaia/commit/bcadbf5bff770e6e7034e056d46189b3d84b72f7
status-b2g-v2.0:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•