Closed Bug 981190 Opened 12 years ago Closed 12 years ago

Mochitest on device, device should restore previous profile after a run

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: onecyrenus, Assigned: jgraham)

References

Details

Attachments

(2 files, 3 obsolete files)

Currently: After you run mochitests on device the profile is not easy to restore. You have to go onto the phone and delete user.js.
Attached patch bug981190.patch (obsolete) — Splinter Review
Resets the profile so the device returns to normal after a run.
Attachment #8387959 - Flags: review?(ahalberstadt)
Attached patch bug981190.patch (obsolete) — Splinter Review
just realized this was in mozilla central, running a try run as well.
Attachment #8387959 - Attachment is obsolete: true
Attachment #8387959 - Flags: review?(ahalberstadt)
Attachment #8387963 - Flags: review?(ahalberstadt)
Comment on attachment 8387963 [details] [diff] [review] bug981190.patch Review of attachment 8387963 [details] [diff] [review]: ----------------------------------------------------------------- This would delete a users changes if they had a customized version of user.js prior to running mochitests. I think what you want to do is delete the backup_file in an else clause here: http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozrunner/mozrunner/remote.py#85 Also while you're modifying this area of code, would you mind changing the dm.shellCheckOutput(['dd', ...]) commands to use dm.copyTree()? Thanks!
Attachment #8387963 - Flags: review?(ahalberstadt) → review-
Ahal, actually i think the usability is a bit differt. The user.js is already backed up if one previously existed http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozrunner/mozrunner/remote.py#331 The use case i am addressing here is if one doesn't exist, we place a user.js there for testing, and it doesn't get removed. In the case where the file has been backed up and there is an orig file then http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozrunner/mozrunner/remote.py#85 yes this case will work we will move the orig --> user.js .. at least that is the way i read the code. can do on the copyTree
Attached patch bug981190.patch (obsolete) — Splinter Review
https://tbpl.mozilla.org/?tree=Try&rev=df7cf04abd1f Updated the patch to use copyTree
Attachment #8387963 - Attachment is obsolete: true
Attachment #8389652 - Flags: review?(ahalberstadt)
Comment on attachment 8389652 [details] [diff] [review] bug981190.patch Review of attachment 8389652 [details] [diff] [review]: ----------------------------------------------------------------- Oh I see why my suggestion wasn't working.. we only add the file to backup_files if an original exists already: http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozrunner/mozrunner/remote.py#56 I still have to r- this because you have self.user_js in RemoteRunner.cleanup() which doesn't have a user_js property. Please move it to B2GRunner.cleanup() (before the RemoteRunner version gets called).
Attachment #8389652 - Flags: review?(ahalberstadt) → review-
Attached patch bug981190.patchSplinter Review
moved this, B2GRunner definitely makes more sense.
Attachment #8389652 - Attachment is obsolete: true
Attachment #8390039 - Flags: review?(ahalberstadt)
Comment on attachment 8390039 [details] [diff] [review] bug981190.patch I think you forgot to qref or something, this is the same patch as last time :)
Attachment #8390039 - Flags: review?(ahalberstadt)
Er, sorry that needed more description (moz-git-tools n00b error) :) I ran into the same problem before I saw this bug and made a patch using an alternate approach; this will store a list of all backed up files that have no original to restore and remove the added file during cleanup.
Comment on attachment 8390651 [details] [diff] [review] Remove all added files in cleanup Review of attachment 8390651 [details] [diff] [review]: ----------------------------------------------------------------- Thanks lets do this as it's more generic.
Attachment #8390651 - Flags: review+
Status: NEW → ASSIGNED
Component: Mochitest → Mozbase
OS: Mac OS X → All
QA Contact: hskupin
Hardware: x86 → All
Assignee: nobody → james
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: